Hi All,
I'm taking my first steps in script runner for jira, and though I've read (and tried) a lot questions & answers here , I'm still facing issues, so here goes:
I need to create a few tasks based on values of multi selection customized field, here are the details:
I have a custom field " Office" from type multi-selection list, let's say OfficeA, OfficeB, OfficeC.
When a task is created I need to create separate tasks, according to the selected values in the "Office" field. Each of those tasks must have the same field values as the original one, but Office" which needs to be marked with a single value which was selected.
For example: if selected values are OfficeA, OfficeB the result will be 2 (almost) identical tasks, the only difference is that one of them will be Office=OfficeA and the other Office = OfficeB.
After the creation of the additional tasks - I don't care about the original task, if it helps I can use it as one of the "new" tasks (with removal of redundant "Office" values)
No need in coping comments, links, etc. only the fields.
We use Jira server 8.5.6 , and script runner 6.16.0, I added a post function in the "create" transition which uses the "clone an issue, and links", currently I have in condition 'OfficeA' in cfValues['Office']. Value, but I don't know how to fill the "Office" value for the cloned task since it will also clone another task in its create transition L
A few question here:
- Is there a way to clone all required tasks us a single post functions or should I add post function per optional value of "Office"?
- How do I avoid the internal loop of create transition (in other words – how to write the condition such it will duplicate only the original task?)
- I also wanted to assign specific user for every "Office" value, I tried to use issue.setAssigneeId('OfficeA_user') but that didn't work , I understood that there was an issue with the set function and I should use the update but couldn't understand hoe to use it (nor the difference between them)
Any assistance will be appreciated J
Thanks
Keren