Copy value from field 1 to field 2 on Automation JIra

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

I reviewed other posts and still cannot find the solution.

I want to copy the value from customfield_10118 to 10122.

I created an automation rule for copy field and in value, I selected the Set Value: 

SetValue{{customfield_10118}} and it still did not work.

Then I removed this and tried with the More Options section. 

{
"fields": {
"customfield_10122": {{issue.customfield_10118}}
}

 

3 answers

1 accepted

13 votes
Answer accepted
Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

Ok, I finally solved the issue with a work around.  For others the use case is:

I want to automatically set the custom field Approver with the value of the Manager custom field.  The Manager Custom field is synced with AD via the AD Attribute Sync to Jira plug-in.

NOTE:  Don't waste your time following the AD Attribute Sync instructions for doing this for it doesn't work on Create Issue.  The AD Sync happens AFTER the create issue.  My workflow for new requests goes directly to Waiting for Approval status versus and Open status. 

Solution:  

1) Create an Automation Rule that is scheduled time use 30 * * * * ? *  for every 30 seconds

2) Conditions:  Approver is Empty

3) Edit Issue and select the Approver field

4) In More Options: paste the following where "customfield_10122" is my Copy To field and "customfield_10118" is the Copy From.  You cannot use display name, etc and must have the accountid.

{
"fields": {
"customfield_10122": { "id": "{{customfield_10118.accountId}}" }
}
}

I hope this will help others have trying to modify the post functions, create automation trigger on create, etc.  

I don't think this is the best answer but it is a workaround for I have submitted the issue to Deventi for their plug-in.  

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

Glad you got it working!

Kieran Jacobsen July 11, 2023

Hey Kathi,

 

What did you set as the JQL query for the schedule? When I try specifying `Approvers = EMPTY`, I get an error `Field 'Approvers' is not searchable, it is only sortable.`

Like John Funk likes this
0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

Hey Kathi,

This is what I do:

screenshot.png

Use the JQL to identify the issues you want to copy the fields within.

Then do the Edit Issue and select the field that you want to copy TO. 

Then chose copy from current issue and select the other field. 

Same and publish and activate. 

Then click the Run Rule Now to copy the values. You might want to practice with a single issue like I have in my example. If that works, then do your full query. 

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

I will try this but I was wanting this run on Creation to set the Approver field so it can transition to the next work flow for JSD

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

Oh, sure you can do that as well - just change the trigger type from Scheduled to Issue Created. 

This is another one of my actual ones:

screenshot.png

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

Can you show me the setting for the "Edit Issue Fields" for approvers?  I am trying to set the value to another field value

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

That's what's in the image above  :-)  I am copying from the Data Schema Owner to the Approvers field. 

Are you able to see that in your rule? 

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

Can you click on the component for "Edit Issue Field Approver" and take a screen shot on the settings?  

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

My screen has Approver and when I click to Copy I cannot select the other field like you have for Scheme Data Owner, so I wanted to see what you had in More Options

Like John Funk likes this
Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

I figured it out!  I did not know you had to click on the word Copy and the pop up appears to allow you to select the field to copy from!

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

Were you able to test it out and get it to work? 

Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

No. I am stuck.  From the Azure AD Attribute plugin, it states to use a scheduled time to update the issue for AZure AD sync happens AFTER the create and not a post function (which they said worked but doesn't after searches and logging a bug).   Sooo  I tried the scheduled time to run every 30 mins when transitioned to Open to Waiting for Approval AND approver is empty.  It runs  and shows values and states it was edited but when I check the issue it still shows Approver as empty.  Approver.gif

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 15, 2021

What do the details of the last step look like?

0 votes
Kathi Paquet
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2021

I looked over the JSON and still not working with the following:

{
"fields": {
"Approver": {{Manager.name.asJsonObject("key")}}
}
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events