Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JMWE Cloud Create Multiple Issues with Different Summary and Description values

Ashvin March 18, 2022

We need to create multiple sub-task tickets, in same project, when a Bug ticket is created.  Each sub-task will have a different summaries (part of it will be the summary of the Bug ticket), different descriptions, and different assignees from each other.  I have the iterator set, but somehow the summary on the create for the sub-tasks is "null".  

Screen Shot 2022-03-18 at 5.28.17 PM.pngScreen Shot 2022-03-18 at 5.27.56 PM.png

1 answer

1 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2022

Hi @Ashvin 

the syntax to access the summary attribute of the current iterator value is simply:

it.summary

Also, the iterator is incorrect for the summary and for the assignee. Use this instead:

[ 
{summary:"Bug investigation", assignee: "accountId:1234"},
{summary:"Requirements SRS", assignee: "accountId:5678"}
]

and then for the Summary field, use:

{{it.summary}} ({{issue.fields.summary}})
Ashvin March 18, 2022

@David Fischer 

That all worked, Thank you, thank you for that quick solution/fix.  

 

Just one more little thing: when setting the assignee field, the Bug issue type does not have the Assignee field on the Create screen to be set, so the value is unassigned.  How to set the assignee for the sub-tasks to be whatever it is on the parent, even it is not set to any user, since this workflow is actually used in 43 diff projects.  

Currently, I have : {{it.assignee}} ({{ issue.fields.assignee.accountId }}) 

however, that is not correct as the value is "unknown" for both accountId and id as well.  

 

There are also a few "Warning" messages in the JMWE log file indicating that the post-function is still using usernames and must be updated to use accountIds instead, but this is exactly what I have written.  

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2022

Hi @Ashvin 

the value for the Assignee field should be only an accountId, so:

{{it.assignee}}

As for your question, I didn't get what the problem is for the Bug issue type. 

Ashvin March 18, 2022

@David Fischer 

There really was no question related to Bug issue type.  I was just providing a little more context/detail regarding the purpose of this post-function.

 

Again, thank you for the quick solution to my question/need.

Ashvin March 18, 2022

@David Fischer 

So, seems the summary fields of the new sub-tasks are not actually picking up the value being set in the Iterator with the parent's summary field value as the code is set to set, only the ({{issue.fields.summary}}) the actual value of the parent summary field is being set for the sub-tasks.

 

Also, it seems that even though the iterator indicates (from what I have read/understand) that 2 new tickets should be created, there were 6 created now.  I have a conditional that should stop any sub-tasks from being created in the project that I'm using for the testing: 

{{ issue.fields.project.key == "ONHOLD" }} && {{issue.fields.issuetype.name == "Bug"}}

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 18, 2022

Can you share your full post function configuration ? As for your conditional execution script, it’s incorrect: the "and" operator is actually and and it should be inside the curly braces:

{{ issue.fields.project.key == "ONHOLD" and issue.fields.issuetype.name == "Bug"}}
Ashvin March 18, 2022

Attaching screenshots of configuration as requested.Screen Shot 2022-03-18 at 10.13.52 PM.png

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 19, 2022

Hi @Ashvin ,

you have an extra double quote on the second line of your iterator. Please double-check.

Ashvin March 19, 2022

Hi @David Fischer 

You were correct.  I removed that extra double quote and modified the condition to read only if the issue was type Bug should the post-function be executed.  

 

However, there were still 6 sub-tasks created instead of just 2, based on the iterator.  here is the modified iterator: 

[ {summary: "Bug Investigation " + , description: "", assignee: "accountId:5e46f12d2a59dc0c8fe4c51d"},
{summary: "Requirements SRS "+ , description: "", assignee: "accountId:5e46f12d2a59dc0c8fe4c51d"}
]

and the condition:

{{issue.fields.issuetype.name == "Bug"}}

 

Second issue is that Summary of the sub-tasks tickets are including only the Summary from the "parent" Bug ticket and not what is part of the iterator.  The value of the Summary fields should be set to what is in the previous screenshot, also pasted here:  {{it.summary}} ({{issue.fields.summary}})

Screen Shot 2022-03-19 at 10.45.20 PM.png

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2022

Now there is a "+" after the summary value that shouldn't be there. As for 6 subtasks being created, I have no idea why. Can you post a screenshot of the whole post function configuration?

Ashvin March 23, 2022

@David Fischer 

 

Here is the screenshot of the post-function config from the workflow:

Screen Shot 2022-03-23 at 8.56.03 AM.png

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 23, 2022

Hi @Ashvin ,

you need to check the "Iterator returns JSON" option.

Ashvin March 23, 2022

Hi @David Fischer 

 

Made the change and now receiving a new error: Unexpected token s in JSON at position 3

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 23, 2022

Right. The JSON syntax is incorrect, attribute names need to be between double-quotes. Sorry about that.

[ 
{"summary": "Bug Investigation ", "description": "", "assignee": "accountId:5e46f12d2a59dc0c8fe4c51d"},

{"summary": "Requirements SRS " , "description": "", "assignee": "accountId:5e46f12d2a59dc0c8fe4c51d"}
]
Ashvin March 23, 2022

@David Fischer 

 

Thank you once again for helping me understand and fix this post-function.  It's working now as expected.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events