Forums

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

Automation doesn't work

Natalia Chojnacka November 23, 2021

Hi!

I have a problem with my automation. I want to assign issues to specific user after creating them. I chose exactly the same options as here: https://www.atlassian.com/software/jira/automation-template-library/auto-assign  and the automation doesn't work. I checked the logs after creating a new issue and the automation has failed. The reason is that the issue didn't meet the condition. What might have gone wrong?

1.png2.png3.png

2 answers

1 accepted

1 vote
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.
November 23, 2021

Hi @Natalia Chojnacka -- Welcome to the Atlassian Community!

The issue created trigger may have timing issues, where the rule fires before the issue data is fully available.  This can lead to rule conditions not matching.

The work-around for this is to add a Re-fetch action immediately after your trigger, and before your condition.  This will reload the data and slow the rule down prior to the conditions.

Kind regards,
Bill

Natalia Chojnacka November 24, 2021

Hi!

 

Adding a re-fetch action worked perfectly! Thank you for your help.

 

Regards,

Natalia

Like Bill Sheboy likes this
Doug Levitt
Contributor
June 24, 2022

Hi @Bill Sheboy 

So, I have an automation which triggers when an Issue is Created.

Within Jira Project A, the Default Assignee is set to the Project Lead.

Within Jira Project B, the Default Assignee is set to Unassigned.

After the automation is triggered, the very first condition is an If/else block which checks for -- among other things -- if the "Assignee is empty".

For new tickets in Project A (where the issue is assigned by default to the Project Lead), apparently the auto-assignment was taking a long time.  As a result, my If condition was passing (because the assignment had not yet occurred).

So, I added a step to re-fetch issue data. However, the auto-assignment was still taking too long. As a result, my If condition was still passing (because the assignment had not yet occurred).

So, I added another re-fetch data (for a total of 2).  Still that didn't work.

So, I added another re-fetch data (for a total of 3).  Still that didn't work.

So, I added another re-fetch data (for a total of 4).  Still that didn't work..

Am I doing something wrong?  Is there a better way to wait for the auto assignment to work?

How many re-fetches are needed.png

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.
June 24, 2022

Hi, @Doug Levitt 

First thing: wow, that surprises me it takes that long!  I would submit a defect for that one to Atlassian.

Is this a global/multi-project or a project-scope rule?

As for a work-around, there is no available smart value/action to set a user field to the Project Lead yet.  But you could disable the automatic set to the Project Lead, and then use your rule to call the REST API with a webrequest to get the user and set from there: https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/project-getProject

Kind regards,
Bill

Like Doug Levitt likes this
Doug Levitt
Contributor
June 24, 2022

I submitted a support case.  I will keep you updated.

Like Bill Sheboy likes this
Doug Levitt
Contributor
July 5, 2022

@Bill Sheboy

So, as it happens the re-fetch data operation was working properly.

What wasn't working?  Well, the Automation was providing misleading information in the audit log for the If/Else block (see: https://jira.atlassian.com/browse/JSWCLOUD-23209).

Typically, I use Slack Messages (in my Automations) to facilitate debugging and troubleshooting.  For whatever reason, I hadn't done that and relied on that inaccurate information (in the audit log) for deducing what was happening.  I guess that was a mistake.

Doug

Like Bill Sheboy likes this
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.
July 5, 2022

Thanks!  That one is a troubling and curious behavior.  Lots of people, including me, rely on the audit log for tracking rule behavior...and seeing this is gonna make me check my rules more closely.

Like Doug Levitt likes this
Doug Levitt
Contributor
July 5, 2022

I added a comment to the ticket indicating the following:



Since this is an "Audit Log", I would suggest that the priority be raised. As any of your customers operating in a regulated environment would need to abandon this mechanism entirely. I would argue that this is at least Major and possibly Critical (at least this has applied to any software I have built where auditing is known to be incorrect).

Like Bill Sheboy likes this
0 votes
Sebastian Krzewiński
Community Champion
November 23, 2021

Hi @Natalia Chojnacka 

 

Automation looks fine. Did issue was unassigned during creation? 

Can you share screenshot from audit log?

 

Regards,

Seba

Natalia Chojnacka November 24, 2021

Hi,

yes, my issue was unassigned during creation. Audit log:

Zrzut ekranu 2021-11-24 o 09.53.25.png 

Suggest an answer

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

Atlassian Community Events