How do i use IDs?

Originally asked by Thilo Baier on 23 May 2020 (original question)


for example i have status cool with id 4711 and mega with id 6677 how would i use them?

if (issue.status.name == "4711" || issue.status.name == "6677") {
Status.receive(useRemoteStatusByDefault = true, workflowMapping = [
"Resolved" : "4711,
"Closed" : "6677"
], resolutionMapping = [:])
}

Do i use " or ’ or just the ID without " or '?


Answer by Francis Martens (Exalate) on 23 May 2020

You can compare against the id of the status like in

if (issue.status.id == 4711 || issue.status.id == 6677) {
...
}

The Status.groovy external script assumes that the value part of the workflowMapping is a name and not an id.
Of course - you can adapt in the external script.


Answer by Thilo Baier on 23 May 2020

Thanks for the fast reply.

Does that also mean i use

"Resolved" : 4711,
"Closed" : 6677  
  
instead of
"Resolved" : "4711",
"Closed" : "6677"

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.