Script runner - customizing subtask summary and assignee while creating sub-task

Within groovy listener context, I was able to create a subtask fine, based on a condition. Basically, if "Doc Required" field is checked to "yes", create a sub-task. The snippet as follows -

cfValues['Doc Required']?.getValue() == 'yes' && ! issue.subTaskObjects.any {it.issueTypeObject.name == "Bug"} 

where "Bug" is the Issue type in parent ticket. This does create sub-task.

Now, I set the Target issue summary as:

issue.summary = '[doc-subtask]' + issue.summary

also set the custom field as issue.assigneeId = 'docs@xyz.com' 

The problem is when the sub-task issue is created, it takes only one of the two. Sometimes it takes up issue.summary while some other times, it takes up issue.assigneeId. But not both of them together. 

How can I have both of them together, in the sub-task ticket ? Also, see if my approach is right for what I am describing. 

Jamie - thanks for your time.

dvps-177-picture.PNG

1 answer

1 accepted

try:

Additional issue action:

issue.assigneeId = "<UserName>"
issue.summary = '[doc-subtask]' + issue.summary

 

 

Udo - thanks and it works. sorry for overlooking the fact that the issue action text box can hold multiple lines.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

514 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you