Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation rule is not updating custom field

Srujana Deva December 10, 2020

I'm trying to edit the issue field when there is an issue transition.

rule.PNG

I have set the edit issue field condition with smart value -> {{issue.created.diff(issue.resolved).hours}}

With this I'm trying to find the get the data in hours and mapped it to a custom number field.

edit issue field.PNG

Rule is executed but data is not updated in the custom field.

Please help me

2 answers

1 accepted

0 votes
Answer accepted
Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2020

Hi @Srujana Deva 

 

{{issue.created.diff(issue.resolved).hours}} will give negative value as order matters!

Try other way around: {{issue.resolved.diff(issue.created).hours}}  or else please add try to paste the value to audit log and test the output. You can take help from here to debug a rule.

 

Thanks
Sherry

Srujana Deva December 10, 2020

I changed the smart value too and even then no value is updated in the custom field.  Let me add debug after updating {{issue.resolved.diff(issue.created).hours}}.

The audit log says it is successful.

audit log.PNG

Sherry Goyal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2020

Technically resolution means when it moves to done status. I think you are moving it to another status. You should try {{now.diff(issue.created).hours}}

I would suggest to add "Log action" and try to print values there if this does not works.

Srujana Deva December 10, 2020

I tried adding debug for your last smart value {{issue.resolved.diff(issue.created).hours}}. Nothing in logs too.

Let me try what you suggested right now and add debug. I am adding log to print values but earlier didn't see anything.

Srujana Deva December 13, 2020

Thanks @Sherry Goyal 

{{now.diff(issue.created).hours}} resolved the issue. I am able to seed the data to custom field now.

Like Sherry Goyal likes this
0 votes
Liam Green
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.
December 10, 2020

Hi @Srujana Deva 

Welcome to the Community!

Have you checked that the name of the field is correct?  It isn't always easy to spot.

Regards, Liam

Srujana Deva December 10, 2020

Hi @Liam Green ,

Thank you for the reply!
Yes I have provided the name of the field right.

I see that the rule is executed but data is not updated in the custom field.

I took the formula from https://community.atlassian.com/t5/Automation-questions/How-to-calculate-the-resolution-time-as-a-difference-between-2/qaq-p/1488447

 

Am I doing it right?

 

Regards,
Srujana

Srujana Deva December 10, 2020

What I want to do is simple when the issue is transitioned to "In QA" status then I want to update "Time taken to resolve" custom field with "{{issue.created.diff(issue.resolved).hours}}" which gives me the duration between created and resolved in hours.

Liam Green
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.
December 10, 2020

Can you take a screenshot of the audit log from Automation please?

Srujana Deva December 10, 2020

audit log.PNG
Rule execution is working fine. I'm seeing success status but no value updated in the custom field

Jay Keck May 20, 2022

I'm having the same problem,  where I'm performing a math operation on a number field using smart values and it doesn't seem to do anything. My log messages show the number being the same before and after the increment operation, no errors in audit log, but my number isn't changing. I'm wondering if anyone has solved this, are smart values not supported within an automation script assign operation? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events