Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Check last time automation rule ran

Hello,

I am creating an automation rule that is triggered by a web hook, however, I would only like to trigger it IF it has not already run this week.

Context: When we deploy our weekly release, we want to mark the lastUnreleasedVersion in Releases as Released. However, there are cases where we might release again the same week to fix a minor bug, but we don't want to have this cause the rule to mark the next version as released.

 

I feel like this should be simple to have "If this rule.lastRun < 7 days ago, then skip", but I cannot find anything like that. 

 

If that is not possible, I could also do something like "If nextUnrealedVersion.ReleaseData <= today, then execute"

Again, I was not able to find any way to do this.

 

Any help is appreciated! 

2 answers

1 vote
Mikael Sandberg Community Leader May 21, 2021

Hi @Isabel Mangan,

Welcome to Atlassian Community!

As you have discovered, what you are trying to do is not possible to do, since the automation cannot check its own audit log as part of a condition. I would consider doing this check on the side that is triggering the web hook if possible. What is triggering the web hook in the first place? Are you using an automation platform like tray.io?

The web hook is coming from a deploy script that we run locally.

If checking the automation audit logs is not possible, would be second idea be possible? Checking something like this: "If nextUnrealedVersion.ReleaseDate <= today, then execute"

Mikael Sandberg Community Leader May 21, 2021

Not from within Jira, you would have to check the release date of the version via REST API, a call to Get project versions can get the release date.

Hi @Isabel Mangan 

This is certainly an interesting use case... And I checked and could not find any related suggestions to it for checking the rule's own execution history.

What is in your webhook data?  Does it have one or more of the issues in the release contents?  If so, you use use the issue to check the status of the release prior to trying to release:

{{issue.fixVersion.last.released}}

Best regards,

Bill

Hi Bill,

Currently the webhook is empty and we are just triggering when we receive the webhook call. The deploy script is just a wrapper to deploy a staging branch to various clusters. I could look into sending info to use here, but couple of clarifying questions:

* Would just sending the ticket number be enough to get {{issue.fixVersion.last.released}}, or would I need to send a full issue? The thing here is just to get the ticket number would require us looking through the git commits of the branch we are releasing and looking for a ticket number

* Does {{issue.fixVersion.last.released}} return a date? And then I would check that to see if it is < 7 days old

Hi Isabel,

You would only need one issue key in the release.  Then you could do a branch on JQL to get the issue for that key, and then check the version information before deciding to release the version.  The available info would include: 

Available properties

  • {{issue.fixVersions.name}} - Returns the name of the fix version.
  • {{issue.fixVersions.description}} - Returns the description of the fix version.
  • {{issue.fix.Versions.archived}} - Returns true if the fix version is archived, and false if not.
  • {{issue.fixVersions.released}} - Returns true if the fix version is released, and false if not.
  • {{issue.fixVersions.releaseDate}} - Returns the fix version's release date...

 

Note in my earlier post I suggested {{issue.fixVersion.last... as I did not know if you have multiple release versions assigned to an issue.  if you don't, you may drop the last.

Hi Bill,

This seems a bit too complex for what we are looking for, so I'm just going to change to a scheduled automation and accept that the timing won't be exactly lined up with when we actually release.

Thanks for the help though! 

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

200 views 6 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you