Writing a script to copy part of parent summary to subtask summary. Edited

I am trying to find the best solution to do the following:

When a certain JQL condition is met, grab the first part of the parent case summary and concatenate the subtask summaries. 

Let's say:

The parent summary is "Personal Dashboard - Regression Testing"

And the subtask summaries are 

  • Manual Testing
  • Automated Testing
  • Documentation

And my JQL condition is "issuetype=Story and text ~ "regression testing" "

Then, after the script is executed, I would like the summaries of the subtasks mentioned above to be updated to:

  • Manual Testing - Personal Dashboard
  • Automated Testing - Personal Dashboard
  • Documentation - Personal Dashboard

 

I'm using Jira Cloud and so far have tried using the Automation add on but haven't had any luck. Would using Script Runner be a better option for this use case? Is there a way to do this with the Automation add on? Any insight would be greatly appreciated. 

 

2 answers

1 accepted

This widget could not be displayed.

Hey there Elle, 

You should be able to set the summary of your subtasks by using the String functions. (see https://codebarrel.atlassian.net/wiki/spaces/AUTO4J/pages/51691794/Working+with+Strings)

You can loop over the subtasks and set the summary field of the subtask to:

{{issue.summary}} - {{issue.parent.summary.substringBefore("-")}}


Your rule should look something like:

Automation_rules_-_JIRA.png 

Let us know if that works for you!

Cheers,

Mark C

This worked! Thanks!

Great article! 

This widget could not be displayed.

I'd encourage you to look into Scriptrunner. It'll take some coding, but I'd be surprised if Scriptrunner couldn't handle it. 


Here is some of their documentation which might be helpful. 

http://scriptrunner-docs.connect.adaptavist.com/jiracloud/script-listeners.html#_store_subtask_estimates_in_parent_issue_on_issue_events

Thank you so much!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

576 views 25 15
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