Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation rule to add days in status to the duedate field

Sara
Contributor
August 29, 2025

Hello, I need to create an automation so when a ticket is transitioned from a Status "W problem" to another one, sum the days the ticket was in that status to the current value of the field "due_date", but is not working, can someone help me?

This is the automation:

  • create a variable: daysinWP with the value:
    • {{Time in W Problem.days}}
  • set duedate: 
    • {{issue.dueDate.plus(daysinWP, "days")}}

       

I've tested to send the value of the variable via email and is empty, how can I know the days a ticket is in a concrete status?

Thanks in advance.

2 answers

0 votes
Bill Sheboy
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.
August 29, 2025

Hi @Sara 

Neither of the syntaxes you show are valid for smart values for date / time functions:

  • there is no built-in smart value to determine the number of days a work item has been in a specific status
  • please look here for the correct syntax to increment a date / time value: {{issue.someDateField.plusDays(123)}}

 

For the scenario you describe, I can think of two ways to get the number of days a work item has been in a status with automation rules, both of which have limitations:

  1. Add a custom field to record when the work item enters a status, and set that value using a rule triggered on work item transitioned...then use that custom field in your later rules.  This rule will cover most, but not all cases of transitions.  And, you would need to decide what to do when a work item exits the status and re-enters it later.
  2. The rule could use the Send Web Request action to call the REST API endpoint to get the changelog entries, parsing them to get the correct one.  The limitation with this approach is only up to 100 records at a time can be returned by the endpoint, and thus if the work item has changed frequently, repeated calls with paging would be required to find the transition record.  Rules cannot loop sequentially in such cases, making this quite difficult.

Another approach is to investigate marketplace apps which better support querying the changelog directly, although I have no recommendations for any of those.

 

Kind regards,
Bill

0 votes
Marc - Devoteam
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.
August 29, 2025

HI @Sara 

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

1. what type of project is this (e.g., company-managed, team-managed, etc.), 

2. images that show your complete rule.

3. images showing the details of any relevant actions/conditions/branches.

4. images showing the Audit Log details for the rule execution.

5. Explain where the issue is.

These questions are not for not willing to help, but to have community members understand on how automation works.

Sara
Contributor
August 29, 2025

Project type: Software projectCaptura de pantalla 2025-08-29 a las 14.03.14.png

Captura de pantalla 2025-08-29 a las 14.11.47.png

The email received is: "Value for variable daysinWP:"

Content defined in the rule: "Value for variable daysinWP: {{daysinWP}}"

Marc - Devoteam
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.
August 29, 2025

Hi @Sara 

On adding a log action on the custom field, I think you smart value is wrong.

If you use {{issue.Time in Webshop Problem.days}}, or {{issue.customfiield_xxxxx.days}} what is the result.

Where xxxxx is de id of the custom field.

What kind of field type is this field, number or date?

Also see this KB for a solution, get-the-amount-of-time-a-jira-issue-was-in-a-status-using-automation 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events