Forums

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

Smart value for last successful automation rule run

flaimo
Contributor
April 12, 2025

I'm planning to regularly query an external service using Jira Automation's web requests, running the query every few minutes. Instead of hardcoding a fixed time period into the API query, I'd like to dynamically use the timestamp of the rule's last successful execution. This would allow the automation to handle Jira outages more effectively, ensuring that no data from the external service is missed.

Is there a Smart Value that stores the date and time of the rule's last successful run?

2 answers

1 accepted

2 votes
Answer accepted
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.
April 12, 2025

Hi @flaimo 

For a question like this, context is important for the community to help.  Please post the following:

  • what version of Jira are you using: Cloud, Server, or Data Center
  • for Cloud, what type of project is this: company-managed, team-managed, JPD, etc.
  • an image of your complete automation rule in a single image for continuity
  • images of any relevant actions / conditions / branches
  • an image of the audit log details showing the rule execution
  • explain what is not working as expected and why you believe that to be the case

Until we see those...

 

Let's assume your rule looks like this:

  • trigger: some trigger
  • action: Send Web Request
  • action: do something else

The key is what options are selected for the Send Web Request action, as it may halt the rule or continue processing.  If you are halting on errors, the rule could invert that and when the call succeeds, save that date / time for monitoring: in a work item custom field or entity property, in a project entity property, etc.  Then use a dashboard or other mechanism for reporting.

 

However, if instead you are asking more generically about any rule success / failure monitoring...

There is no smart value stored with work items (formerly called "issues") for the last successful automation rule execution; that information is only in automation audit log, and...

There is no public REST API yet for automation rules and their logs.  Here is the suggestion to add that feature, which is currently marked as "in progress": https://jira.atlassian.com/browse/AUTO-51  (You may find posts about people using discovered, internal endpoints and I recommend against using them.)

Even if you had a REST API to view the logs to detect success or failure, that may not help.  The reason is a rule may "succeed" and not complete the expected processing.  The specifics depend upon what the rule is intended to accomplish.

 

Finally, your post seems to indicate you are on a Free license level.  Is that correct?  If so, I suspect you may consume your monthly usage limit when a rule with a scheduled trigger runs too frequently AND performs a countable-action.

 

Kind regards,
Bill

0 votes
sanam malleswari
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 12, 2025

Hi @flaimo ,

Since that smart value doesn’t exist yet, you can use a workaround:

Use a custom field or entity property to save the last run time manually.

Here’s the idea:

  1. After the rule runs successfully, have it store the current time somewhere (like in an issue field, or with an entity property).

  2. On the next run, your rule can read that stored time and use it in your web request.

  3. After the request, update the stored time again.

Think of it like writing down the time in a notebook every time your automation goes out. Next time, it checks the notebook to see when it last worked.

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.
April 12, 2025

Hi @sanam malleswari 

As a reminder, when posting content generated by a bot / AI tool, the community guidelines require disclosing the source in the post text.

To learn more, please review the guidelines here:

https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer