Status sync not working

Originally asked by Martin Niňaj on 04 May 2020 (original question)


Hello, we need to sync only one status Closed. There is lot of different statuses on both sites. We only need to sync, if one issue is closed, other issue should close too.

But we are getting error - “Can not find status `Fixing` in workflow `NEW Client WEB Workflow_EN_v1`”

On Jira1 outgoing sync is: replica.status = issue.status
On Jira2 incoming sync is:

def statusMap = [“Closed”: “Closed”]
def remoteStatusName = replica.status.name
issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)

what are we doing wrong?

thank you
Zdroj: Jira Server/Datacenter (old community)


Answer by Juan Grases on 04 May 2020

Hi!

Something like this would work:

Incoming script:

if(replica.status.name == "Closed"){
  issue.status = replica.status
}

This assumes the status is named Closed on both sides, if it’s named different, you might do:

if(replica.status.name == "Closed"){
  issue.setStatus("Done")
}