The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe

Questions

 
1
0
-1

Is there any way I can loop the value I get from the checkbox/multiple select and use it to determine which project in JIRA for a new issue to be created?



For example something along the way as below:


def checkboxCollection = replica.customFields."Create in the customer facing projects"?.
                                value?.
                                collect{
                                        a->
                                        nodeHelper.getOption (issue, "Create in the customer facing projects", a.value)
                                        }
For each (checkboxCollection) {
        issue.projectKey = nodeHelper.getProject(replica.project?.key)?.key ?: checkboxCollection
        issue.typeName   = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Service Request"
}
    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Andrii, to top up my previous comment, the reson we use checbox is to be able to select multiply. The script you gave me is good is the selection is single.


      We want to be able to select more than one selection and be able to loop it and create project based on it,


      I hope this helps. Thanks!

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

        Thanks for that Andrii, 


        This should work, but I am looking something more dynamic, without specifying the value at all.


        So if today I have 2 values within the checkbox i.e. Project A, project B, project C. Then tomorrow I added project D, I dont have to modify the script each time.


        Does this make sense?

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

          Hi Iona Augustine ,


          You can try to create a condition with a revising if your checkbox has been checked or not.

          Please notice that if you are sure that in your customfields all the checkboxes have some value, you should use a non-commented condition. If not, you should use the commented one.


          Also, please let us know if it worked for you.


          if (replica."Create in the customer facing projects".any {box->box.value == "example"})
          //if (replica."Create in the customer facing projects"?.any {box->box.value == "example"})
                  {
          issue.projectKey = "example"
          }​



          1. Iona Augustine

            Hi Andrii, anything on this yet? If it's not possible then it's OK, we'll work a workaround.

          CommentAdd your comment...