The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

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

Sam Rajagopal
May 21, 2015

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Udo Brand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 21, 2015

try:

Additional issue action:

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

 

 

Sam Rajagopal
May 22, 2015

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