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

Sync Affected Version

 
1
0
-1
Hi, I'm trying to sync the field affectedVersions, but I encounter some problems: (1) sync to the remote field affectedVersions does not work, because there are different affectedVersions on the source/remote side (2) sync to a remote label (with incoming sync issue.labels = replica.affectedVersions) returns an error (One or more labels in 'hubIssue.getLabels' is not of type IHubLabel but `com.exalate.basic.domain.hubobject.v1.BasicHubVersion) I don't want to use a new custom field for that. What is the best practice for this? Maybe sync to a comment with a default text 'Affected version' and then the synced field affectedVersions ? Thanks.
    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Berry


      This is not really out of the box, but exalate offers a groovy script called Versions.groovy which will allow you not only to sync the value on the issue, but also adds it to the list of versions if required. Search for it - it does the trick. 


      1. Berry Kersten

        Hi Peter HochstrasserThanks for the quick reply. I will try that!

        Next to that, is there also an alternative solution for this? For example, sync the source affectedVersions to a comment?

      2. Berry Kersten

        Hi Peter Hochstrasser, I talked to the stakeholders about this solution, but they did not want to add extra values for Version in the remote project.

        So therefore I tried to sync to a custom field 'Reported Affected Version', but I got an error:

        Exception evaluating property 'value' for java.util.LinkedHashSet, Reason: groovy.lang.MissingPropertyException: No such property: value for class: com.exalate.basic.domain.hubobject.v1.BasicHubVersion


        This is the incoming sync config:

        //sync for project UNI
        issue.customFields."Reported Affected Version".value = replica.affectedVersions.value?.value
        //sync for project UA
        issue.customFields."Reported Affected Version".value = replica.customFields."UA Version Number".value?.value
        //sync for project DLM
        issue.customFields."Reported Affected Version".value = replica.customFields."DLM version".value?.value

        Any idea how I can fix this? Thanks!

      3. Peter Hochstrasser

        Hi Berry Kersten


        I expect that you'd need some kind of type conversion between the affectedVersions data type and the string of the custom fields.

        Keep in mind that affectedVersions is potentially a list, not a single value.


        Yours truly

        Peter

      4. Berry Kersten

        Hi Peter Hochstrasserthanks for the additional info. I'm not sure how to convert the affected versions to text and sync that value.

        Therefore, as an alternative approach, I've used the following documentation: https://docs.idalko.com/exalate/display/ED/Sync+between+Cascading+Select+and+Text+custom+fields which resulted in the following incoming sync:

        issue.customFields."Reported Affected Version" = replica.affectedVersions?.value?.parent?.value +
        ", " + replica.affectedVersions?.value?.child?.value

        However, I still get an error:


        Script error for issue UNI-14298. Details: Exception evaluating property 'value' for java.util.LinkedHashSet, Reason: groovy.lang.MissingPropertyException: No such property: value for class: com.exalate.basic.domain.hubobject.v1.BasicHubVersion Possible solutions: name. Error line: Script45.groovy:19


        I assumed this method should work in theory as well as the system field affectedVersions is of type Cascading Select, right?

        In case this method does not work, does Exalate provide some kind of "conversion script"?

      5. Peter Hochstrasser

        Hi Berry Kersten


        There are lots of examples in the community. Also, if you ask iDalko, they are most helpful with their support.


        Just searching for convert in the community yielded the following page:

        https://docs.idalko.com/exalate/display/ED/How+to+convert+remote+status+changes+to+local+comments


        or this here:

        https://docs.idalko.com/exalate/display/ED/Script+rules+examples


        The code shown under heading Versions on that page shows you the attributes of (affected/fix)Versions that you might want to retrieve as strings. value is not one of them.


        As you see, I try to get you fishing instead of putting the fish in your hand.


        Yours truly

        Peter

      CommentAdd your comment...
    2.  
      2
      1
      0

      Hi Peter HochstrasserThe issue is resolved! I've used the info in another Community Question (How to sync Fix version to custom text field

      1. Peter Hochstrasser

        Great - and have fun with Exalate!

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

      Hi Berry Kersten


      You cannot add versions that are not in the list of versions - that's a JIRA restriction you can't circumvent.


      What you can do instead is 

      • create a text field
      • convert the affected versions to text and sync that value.


      Hope this helps.


      Yours truly

      Peter

        CommentAdd your comment...