Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,705
Community Members
 
Community Events
165
Community Groups

Copy custom field values into another custom field

Good day everyone. 

There is a sub-task workflow, which consists of two statuses: Review and Approved. When moving to Approved from Review user should fill Decision field on a transition screen. For example, number of sub-tasks is 7. All of them have their Decision field values.

So, the question is how can I copy all these Decision field's values from different subtasks into a single custom field, let's say, Overall Decision, in parent task? 

Thank you in advance.

3 answers

1 accepted

0 votes
Answer accepted

Hi @Marco Brundel , @Fadoua , 

Thank you for answers. There is a Scriptrunner plugin in the system, but no Automation for Jira Pro version.  

I recreated the rule @Marco Brundel shared, but on Automation Rules (JWT) plugin:

Screenshot_13.png

It works, but there is a problem. When the descision of the first sub-task "marketing approve' is edited to "marketing approve 1", the rule doesn't edit it on the parent task, it just adds it as a new decision. Example screenshot:

Screenshot_14.png

Is there is a way to avoid it? 

Thank you in advance.

Hi @Fariz Aliverdiyev ,

Could you please give me more details about your requirement?

  • What is the type of the custom field "Decision" ?
  • Can different sub-tasks have the same decision? For example, let's say that the second sub-task and the fourth sub-task contain exactly the same decision. Is this possible? Or all of your sub-tasks will contain different decisions.

The following expression should work for your "Update field" action if your sub-tasks are going to have different decisions without being repeated, but if it's not the case, please let us know:

previousValue(%{trigger.issue.cf16147}) NOT IN %{selector.issue.cf16147} ? %{selector.issue.cf16147} + " " + %{trigger.issue.cf16147} : findReplaceFirst(%{selector.issue.cf16147}, previousValue(%{trigger.issue.cf16147}), %{trigger.issue.cf16147})

In order to make this expression work, be sure you selected "Advanced text" mode as parsing mode:

AdvParsingMode.png

Hope to hear from you soon!


Best regards,
Sergio

Hi @Sergio García-Consuegra _Decadis AG_ 

Thanks, it worked! But, yes, the field can contain same decisions, something like "ok" or "approved" and etc. Decision field is a multi-line text. Also, is it possible to add each decision on another line, not on a single line, as on my screenshot above? 

Screenshot_15.png

Hi @Fariz Aliverdiyev ,

For this specific case, I would suggest an easier and more powerful solution, using our Calculated text fields.

  1. Create a new custom field, and the type must be Calculated Text Field (by JWT)
  2. Once it's created, configure it and add the following expression for this calculated text field (be sure the parsing mode is "Advanced text"):
    toString(textOnIssueList(subtasks(), ^%{issue.cf16147}), "<br>")
  3. Once it's created, just navigate to your parent issue and you will see that all the decisions from your sub-tasks are displayed with a break line. This calculated field is always automatically re-calculated, so you won't need to use that Automation Rule anymore.

Please, let us know if this solution worked as expected.

Best regards,
Sergio

Like Fariz Aliverdiyev likes this

Hi @Fariz Aliverdiyev ,

I'm glad to hear the proposed solution worked!

If you have any other doubt related to our plugin, you can always contact us through our official support portal for customers

We will gladly help you :)

Have a good day!

Best regards,
Sergio

Like Fariz Aliverdiyev likes this
2 votes
Fadoua Community Leader May 23, 2022

@Fariz Aliverdiyev  that can be done using a plugin. Either Automation for Jira as mentioned by @Marco Brundel or ScriptRunner for Jira.

Jira out of the box doesn't offer this feature.

Best of luck

Fadoua

Hi @Fariz Aliverdiyev ,

 

I think it is possible with an automation rule.

Acceptance Criteria (customfield_13508) I used as a field in this example

In the edit-issue action I have
{{issue.customfield_13508}} - {{triggerissue.customfield_13508}}
put in the field.
This saves the value that was already in the field.

See this screenprint 
Screenshot 2022-05-23 at 15.54.00.png

regards, Marco 

Fadoua Community Leader May 23, 2022

Only if the user has the plugin. 

Like Marco Brundel likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you