Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

How to sync 2 different statuses in one based on transitions

 
2
1
0

I have Server JIRA with following workflow:

And connected Cloud JIRA with following:

How to achieve:

  • If status transitioned in Server from Open to In progress
    • Then Map status In progress to Investigation in Cloud JIRA
  • If any other transition to In progress in Server (eg. from Done to In progress or from Pending to In progress (transition is missing in the picture but don't mind that)
    • Then Map status In progress to Selected for Develepment in JIRA cloud

?

Optionally

  • If status transitioned in Server from Open to In progress
    • Do nothing in JIRA Cloud workflow
  • If any other transition to In progress in Server (eg. from Done to In progress or from Pending to In progress (transition is missing in the picture but don't mind that)
    • Then Map status In progress to Selected for Develepment in JIRA cloud


?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Arto Kovalainen


      You can construct it as follows using the previous replica named as 'previous'. 
      It contains the message that was sent before the current one.  If the status was sent then, you will be able to know what the originating status was. 


      if (replica.status.name == "In Progress") {
         issue.setStatus(previous?.status.name == "Open" ? "In Progress" : "Selected for Development")
      }
      
      


      Note that the previous replica is not set when exalating an issue, so you will have to use the safe navigation operator after previous, or distinguish using the firstSync boolean.


        CommentAdd your comment...