2
1
0

Hi:

I am synching the labels field between Azure Devops and JIRA on premise server.
I am using the tip here: https://docs.idalko.com/exalate/display/ED/How+to+synchronize+issue+labels
on the JIRA incoming side I have this line:
issue.labels = replica.labels.collect { it.label = it.label.replace(" ", "_"); it }

This works correctly to replace spaces with underscores in a label, but it also inserts an underscore as the first character in the second and subsequent labels synching over from Azure Devops to JIRA.
For example, I have this in Azure DevOps:
Label 1 is: Mag S Tag
Label 2 is: THIRDTAG
Label 3 is: TWOTAG




JIRA gets this:
Labels 1: Mag_S_Tag
Label 2 is: _THIRDTAG
Label 3: _TWOTAG


Does anyone have a suggestion for how I can correct that line?


Thank you,

Maggie


    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Try by adding trim as in 


      issue.labels = replica.labels.collect { it.label = it.label.trim().replace(" ", "_"); it }
      1. Maggie Stearns

        Thank you! That seems to work!


      CommentAdd your comment...