You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I use scriptrunner to create a set of sub-tasks when the status of the parent issue is changed, and I would like to assign the sub-task to the user who is specified in a user-picker field in the parent issue.
Is there a way to do this? any suggestion would be helpful.
Let me know if the question is not clear.
Thank you in advance.
Jun
There are a few examples below the 'Additional issue actions', which led me to doing this:
import com.atlassian.jira.user.ApplicationUser
def cf = customFieldManager.getCustomFieldObjects(sourceIssue).find {it.name == 'Single User Picker CF Name'}
if (cf && sourceIssue.getCustomFieldValue(cf)) {
issue.setAssignee(sourceIssue.getCustomFieldValue(cf) as ApplicationUser)
}
If you're creating those subtasks all within Groovy without using the 'Create a sub-task' postfunction then that would be pretty similar process except that you would do IssueInputParameters.setAssignee() before validation/creating, but that's probably not the case I assume.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for your help again.
The script worked perfectly, it picks the value of the field from the current parent issue, which is exactly I wanted.
I wasn't sure what "If you're creating those subtasks all within Groovy without using the 'Create a sub-task' postfunction" means, creating the subtasks using the other way?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@teisyun I meant that I assumed you were using the 'Create a sub-task' postfunction which is out of box from ScriptRunner, and that one contains the 'Additinal issue actions' box, rather than creating the subtask in your own custom code or some other implementation. In any case glad that you've found it and that it worked :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see, thank you for your quick reply, and Yes, it worked for me!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.