Automatic copy of custom field text (subtask to parent issue)

We have a process where users test against a subtask but the parent issue is used to generate some documentation.

We want to prevent users from Passing each subtask unless there is some text in a custom field on the parent issue. There can be more than one subtask in this process but only one subtask needs to provide the text to the parent issue.

I want to make it easy for users so instead of stopping users and making them go back to the parent issue to complete the field, here are the steps I think could work well:

  • User clicks Pass on the subtask and the transition screen opens
  • If there is already text in the parent instance of the custom field, display it in the subtask instance. User can Pass the subtask.
  • If there is no text in the parent instance of the custom field, disallow Passingof the issue until a minimum of 10 characters is entered in the custom field.
    • Copy the entered text back to the parent instance of the custom field.

My question is: where do I start?! Since I only do very basic code, I usually put these things together by hacking together some sample scripts but I've only found a one-way script that works in the parent > subtask direction. I'd greatly appreciate some pointers.

2 answers

There are probably a number of ways to do this. Here is one I know :).

You can add a Conditioned validator (Conditioned Workflow Functions for JIRA) to the transition that validates the the custom field has 10 characters or more. If not, the transition will be stopped and user can be given a detailed message (using Substitution variables like %parent_key%) to tell them exactly what they need to do allow the transition to proceed.

The condition regex you would need would look something like:

Condition value: %parent_mycustomfieldname%
Regex pattern: .{10,}

0 votes
Henning Tietgens Community Champion Jan 19, 2014

If you can live without the display of the parent value you can go with Bobs suggestion and than add a postfuntion which saves the entered value to the custom field of the parent issue.

Another way would be to spread the value from the parent issue to the childs with a listener (every time the parent custom field is changed write the value to all childs) and only test in the validator of Pass if the value has more than 10 characters.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,080 views 13 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot