Currently using JIRA CLOUD
I am building a new hire form. Once the form is created and a user clicks "Start Progress" I have it so the issue will automatically create a single subtask and assign it to a user.
Note: The New Hire form has about 25-30 subtasks that our team will work on simultaneously from ICT to HR and Finance.
I am new to scriptrunner and groovy and would love a tutorial or guide on where I can find the fields/code needed to make this script work.
You have two options here:
You can create multiple 'Create Subtask' Workflow Post Functions (see http://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_create_subtask) for the 'Start Progress' transition, and also add a Post Function for sending a notification (see http://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_send_notification)
When you are configuring the 'Create Subtask' post function there is an example code snippet you can use to set the assignee, and its simple to set the description using the following code:
subtask.fields.description = "Some description"
For the notification, you can write a code condition that checks the value of a specific custom field:
def customFieldValue = issue.fields['customfield_10234'] // We need to return true or false here in the condition code return customFieldValue == 'Sales'
I hope that helps,
Thanks for the prompt answer I appreciate it. For option 1 I know thats possible but due to the fact that we may have 15-30 subtasks I think the manual creation is too tedious and takes too long to edit and modify. I am new to coding but I saw it was possible to setup intellij ide and connect it to JIRA so I can learn the sample groovy code? Can you point me in the right direction for that setup I tried yesterday for 30 minutes but had no clue what I was doing. For option 2 how can I learn to write the code for this, I just need some reference guides and samples!
I am looking for the same information right now. Did you ever find a good way of creating multiple sub-tasks from a single post function script?
I believe when Jon says to create a listener, he is referring to creating a global listener in the add-ons section under Scriptrunner. However, I am not well versed in Groovy and the script to actually fire the "create sub-task" event would probably take me longer to figure out than to just add 15 individual post function scripts.
Anyway, if you have any lessons learned you would like to share, I would love to hear it.
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
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!
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