Confluence has been updated to ver 6.15.9. In case of any troubles, please contact infra team.

Questions

 
2
1
0

Hi,


I have a use case where sometimes a released version AND an unreleased fixVersion is set on an issue.
When that unreleased version is released (in the release hub) a sync must be performed by using a trigger.


So, in this example (when having a released version AND an unreleased fixVersion):
when I release the (unreleased) version AND setting the date to (for example) today, then I see the corresponding issue in the Issue Navigator when using the following JQL


fixVersion in releaseDate("after startOfDay(-1d) before 10d")


→ releaseDate is determined by using ScriptRunner 


However, when using this JQL in a Trigger, then there's no sync happening. I still have to edit the issue in order to perform the sync.


Does anyone have an idea to solve this problem? Is there another way to sync issues by a trigger when a release is set?


    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      There is no sync happening because the replica before and after the event is identical.
      By adding following code snippet - you force a change on the replica, which leads to a sync


      replica.customKeys.foo = new Date()

      An alternative is to be more specific


      // test if there is at least one fix version which is released
      replica.customKeys.isreleased = 
                         (issue.fixVersions.find { it.released } != null)



      Bonus


      Have a look at this TriggerSync external script
      With ScriptRunner you can capture the version event - and then call the external script to touch all related issues without modification

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Peter Hochstrasser, No. Currently I'm using the following outgoing sync rule:

        replica.fixVersions = issue.fixVersions.findAll{it.released}


        For the incoming sync I'm using 

        issue.customFields."Patch version".value = replica.fixVersions?.collect{it.name}.join(",")


        So it only syncs released versions. In some cases users want to set an unreleased Fixversion, just to show that a version is planned for a specific issue.


        When the release is actually done, I want to (auto)sync the issue.

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi Berry Kersten


          Do you synchronize the versions separately?

          If so, you could implement the solution in the receiving JIRA project, if needed at all.



          Yours truly

          Peter

            CommentAdd your comment...