I am thinking to user Groovy to create two customerized sub-menus, one for sub-tasks' creation and another for sub-tasks' update.
The sub-tasks' summary is like "'Sub 1 - %parent summary%", and assigned to a user, with user name from a fraction of the value of one parent tasks's customField, which is like "user1, 10, user 2, 11, user 3, 12". For example, the assignee of one sub-task is "user 1" (auto matched). And the estimation will be converted from "10"; assignee of anothe sub-task is "user 2", with an estimation converted from "11"
And once the parent's customerField is changed, we can use the "update" menu to update the assignee and estimation.
I am a newbie of Groovy, can anyone give some hint or idea how to do this? Thanks a lot in advanced!
Hi Julie,
What do you mean by sub-menu for sub-task. Are you looking to create sub-task based on workflow post function if yes then you could use something like this
In Post-Function Create Sub-task and in Additional issue actions insert script something like this. First it appends sub-task summary as some text + Parent summary and then based on value of custom field value it set assignee, similarly you can do for estimation field
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.user.util.UserManager import com.atlassian.jira.issue.customfields.option.Option import com.atlassian.jira.user.util.UserUtil def issueManager = ComponentAccessor.issueManager def customFieldManager = ComponentAccessor.customFieldManager def cf = customFieldManager.getCustomFieldObjectByName("Category") //use your custom field name here def cat = (issue?.getCustomFieldValue(cf) as Option)?.value MutableIssue issue = issue issue.summary = 'NEW TASK: ' + sourceIssue.summary if (cat== "test2") { issue.setAssignee(ComponentAccessor.userUtil.getUserObject("jirausername")) }
Taha
Thanks a lot! We will give it a try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also insert menu items using the examples here: https://scriptrunner.adaptavist.com/latest/stash/CustomisingUI.html. They are for Stash but it's the same principal for JIRA, although it's probably a bit more involved than you'd want if you haven't done anything like this before.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.