Originally asked by Francis Martens (Exalate) on 10 June 2020 (original question)
Piotr Kurpik
Your question was deleted by accident - recovering it from notification(。-_- 。)
I follow https://docs.idalko.com/exalate/pages/viewpage.action?pageId=46203325 to sync sprints from one Cloud Jira instance to another and I have a questions: 1. My incoming sync rules start with “if(entityType == “sprint”){” but unfortunatelly I’ve got error - “Script error for issue 433. Details: No such property: issue for class: Script2. Error line: Script2.groovy:1” Could someone advise? 2. I have issues already synchronized, is there any way to sync information which issues belong to which sprints? Thanks in advance for all help.
if(entityType == "sprint"){
//Executed when receiving a sprint sync from the remote side
def sprintMap = ["366":"521"] //[remoteBoardId: localBoardId]
sprint.name = replica.name
sprint.goal = replica.goal
sprint.state = replica.state
sprint.startDate = replica.startDate
sprint.endDate = replica.endDate
def localBoardId = sprintMap[replica.originBoardId]
if(localBoardId == null){
throw new com.exalate.api.exception.IssueTrackerException("No board mapping for remote board id "+replica.originBoardId)
}
sprint.originBoardId = localBoardId //Set the board ID where the sprint will be created
}
if(entityType == "issue"){
return
}
Comments:
Francis Martens (Exalate) commented on 16 June 2020
Do you still have the problem?
There is no ‘issue’ on line 1 in either script
Piotr Kurpik commented on 17 June 2020
I see where the issue was. What I pasted was outgoing script from one Jira Cloud instance (let’s call it A for now) and incoming script from second one (let’s call it B). I do have “issue” in line 1, but in outgoing script on B. But the only trigger I have for this connection is on A, so I believed there won’t be any outgoing action from B to A and no need to edit that. But apparently outgoing script for B is parsed anyway, so I replaced whole it with single “return” and it looks like it works now.
That leaves us only with second question - I asked “is there any way to sync information which issues belong to which sprints?”.
Francis Martens (Exalate) commented on 17 June 2020
> is there any way to sync information which issues belong to which sprints?
Can you clarify what you would like to achieve?
Piotr Kurpik commented on 17 June 2020
Issues in Jira can be assigned to sprints. For example I have project AB with issue AB-1 and board 100 and create “sprint 1” on this board. Then I create project XY with board 101 and enable issues synchronization from AB to XY and sprint synchronization from board 100 to 101. So I have XY-1 which is replica of AB-1 and “sprint 1” on board 101. When I assign issue AB-1 to “sprint 1” on board 100 I’d like to somehow have XY-1 assigned to “sprint 1” on board 101.
I can imagine two ways of doing that:
sprint information could be send during issue synchronization and some helper could be used to match sprint on target board
list of issues could be send during sprint synchronization. Also helper would be required to match issues from target project
I couldn’t find information if any of that is possible