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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,639,044
Community Members
 
Community Events
196
Community Groups

Automation rule is not updating custom field

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.
Dec 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

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.
Dec 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.

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.

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.
Dec 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

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

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.
Dec 10, 2020

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

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

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