How do I sync statusCategory?

Originally asked by Viacheslav on 27 September 2019 (original question)


Is there any way my partner and I can sync the issue statusCategory?Source: Jira Cloud (old community)


Answer by Roman on 27 September 2019

Hey Vyacheslav,

Can you give an example on how the synchronization needs to look like please?


Comments:

Viacheslav commented on 27 September 2019

Sure thing. I need a functionality similar to this:

if (replica.statusCategory == “Done”) {
workflowHelper.transition(issue, “Resolve this issue”)

}

Roman commented on 27 September 2019

Can you try

if (replica.status.category.name == “Done”) {
workflowHelper.transition(issue, “Resolve this issue”)

}

Viacheslav commented on 27 September 2019

I’m not sure about ‘status.category’, in Jira’s JQL it is ‘statusCatefory’. Anyways, I used another approach as follows:

if (replica.status.name == “Escalated” && issue.status.name == “Waiting for customer”) {
workflowHelper.transition(issue, “Respond to support”)
} else if (replica.status.name == “Canceled”) {
workflowHelper.transition(issue, “Reject”)
} else if (replica.status.name == “Closed” || replica.status.name == “Resolved”) {
workflowHelper.transition(issue, “Resolve this issue”)
}