Forums

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

Need help to write conditional automation

Liz Dunphy Mercer May 16, 2024

I need to create a story only if the Fixed version release date is 16 days from the day the rule is run on. There are numerous other checks, but those all work. this is where my rule stops every time, no mater how many different ways I phrase it.  Right now I am trying 

Issue fields condition

Field* (required) → Fix version Start Date

Condition* (required) → equals
Timeframe → 14 Days From now
This condition will check that the Fix version Start Date field equals 16 days from the time that the rule is run.
 
Then I run a second 

Issue fields condition

Field* (required) → Fix version Release Date
Condition* (required) → equals
Timeframe → 16  Days   From now
This condition will check that the Fix version Release Date field is after 14 days from the time that the rule is run.
to basically ask it to find any Epics with a fixed version release date that is 16 days from today.  It stops every time with The following issues did not match the condition, even though they do. 
I have tried a dozen different JQL  queries or smart value combinations,  I just can't get this condition to work and this is the defining condition of the whole rule.

2 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
May 16, 2024

Hello @Liz Dunphy Mercer 

Its hard to understand whats working or whats not working.

Generally, there are 3 options, of which only option 1 is the correct one. Rest of options require assumptions.

Option 1: Daily, make a REST call to get a list of your projects versions and check if any of them have release date 16 days out. Then you do your steps.

Option 2: Requires you to have addons like Script runner. Then you can write a simple JQL to check Daily if any version has release 16 days out, but in this case, it requires you to have issues in the version. If there are no issues, it will not find this version.

Option 3: Requires you to supply -some- JQL to your rule and hope that this list has issues which has release date in next 16 days. This has the same problem as 2. Requires you to have issues assigned the version and you must have supplied it to the rule.

Also, reading your post, I am confused by your "Issue Field Condition". How are you checking release date criteria, what was the issue which triggers this rule etc.

So for us to help, Can you please share your complete rule and audit log so community can take a look? Thanks!

 

Liz Dunphy Mercer May 17, 2024

 

 

 

Liz Dunphy Mercer May 17, 2024

Hi. I am not a developer. I am a PM, so a script runner or rest call is not an option. I am limited to the options under the Automation section. 

all of this works except the bold/underlined condition.

This rule will check all the fix version release dates on all the Epics, make sure the rule was not already actioned on it & then if they are within 16 days of the day the rule is run the it should create the story & subtasks for the use case team to complete to deploy
There is a lot of sub-task creation which is irrelevant,
This is the part that is not working
image.pngas that part works, the below I think is what you all need for the full rule

image.png

It says it passed, but only ARPL-3359 should have past the last condition to be processed

 

image.pngimage.png



as it is the only one with the correct release date to match my condition
image.png








Kalyan Sattaluri
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.
May 17, 2024

Hello @Liz Dunphy Mercer 

Apologies but we dont need the full JSON. Please edit your posts and remove the JSON as its hard to scroll and read. Just a screenshot of the rule and audit log is sufficient if you can.

Liz Dunphy Mercer May 17, 2024

I updated it. LMK if more is needed @Kalyan Sattaluri  @Bill Sheboy 

Kalyan Sattaluri
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.
May 20, 2024

Hello @Liz Dunphy Mercer 

Looking at the rule, first thing I notice is that your smart value condition for fixversion release date needs tweaking.

Your syntax should be:

{{issue.fixVersions.releaseDate.jiraDate}} EQUALS {{now.plusdays(70).jiraDate}}

Because the way you have it, {{now.jiraDate.plusdays(70)}} is not correct and is resolving to NULL and so it is matching issues which *dont* have a fix version to it.

So please change the syntax and rerun the rule...

But, may I suggest, for testing purposes, to keep your scope small.

That is, supply only 1 issue in scheduled trigger which you know will pass all the checks.

If the rule is working, you can expand your scope in your trigger. If something is not working for an issue, you can then isolate the issue by deleting checks and logging info as you go.

Hope it helps, Thanks!

 

Kalyan Sattaluri
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.
May 20, 2024

Should be like below:

image.png

And as mentioned, for testing purposes, instead of below JQL in your Trigger:

"Filter= \"2024 Delivery\" and issuetype = epic and (status = \"in progress\" or status = \"to do\")",

change it to:

key = ARPL-3359

And rerun the rule.

Liz Dunphy Mercer May 20, 2024

@Kalyan Sattaluri  Thank you sooooo much! this did it! I would not have thought of moving the plusdays in the middle, I hadn't seen that format before. I have been trying to solve this for 2 weeks. I really appreciate your help. I think I need to take a class in Automation to better understand the best what to get the results we want.

Like Kalyan Sattaluri likes this
Kalyan Sattaluri
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.
May 20, 2024

Great to hear. Please consider accepting solution if the issue is resolved. Thanks!

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.
May 17, 2024

Hi @Liz Dunphy Mercer -- Welcome to the Atlassian Community!

What problem are you trying to solve?  That is, "why do this?"  Knowing that will provide context to help the community offer better suggestions.

Until we know that...For automation questions like this, please include:

  • an image of your complete automation rule,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution, and
  • explain what is not working as expected.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events