Forums

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

How to stop an automation from proceeding when a step fails?

Evelyn Lewis
Contributor
May 19, 2025

I have a simple automation that takes the description of an issue emailed to us in JSM and adds it instead as an internal comment. It then deletes the description.

It has been working perfectly, except for one time where the first step of adding the comment failed because of the character limit on a comment. However, the next step proceeded.

I need to be able to ensure the automation does not continue if the comment is not added.

Is there a way to force the automation to stop if a step fails? This would also be very helpful in some of our other automations.

I know I could use an 'if then else' branch but a stop if fail would account for many other issues on other automations as well. 

2 answers

Suggest an answer

Log in or Sign up to answer
1 vote
Jaime Escribano
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 19, 2025

Hi @Evelyn Lewis ! Glad to have you in the community.

 

In automation you can make use of Smart Values to verify the lenghth of your description before executing the rest of your automation.

In this example, we would be using the smartvalue {{issue.description.length}}, which you can learn more about here->  Java documentation: Length 

You rule would work the same as it was before:

Trigger: When field is edited [Description, during issue creation]

Conditional: Smartvalue condition-> If the issue description is smaller than 32767.

example.png

 

We use 32767 as it is the max character limit for a JIRA comment.

 

This way your rule won't execute in case of a character excess! Let me know if that helped!

 

Regards, 

Jaime Escribano

 

Evelyn Lewis
Contributor
May 20, 2025

Thanks Jaime. That was an option I was considering but it only accounts for one possible error. If the first step fails for another error then I'm back where I started!

 

Thanks for your help.

 

Cheers,

Evelyn

0 votes
Benjamin
Community Champion
May 19, 2025

Hi @Evelyn Lewis 

 

Welcome. There isn't a direct fail and stop method. To simply the automation a bit. It's like a 2 or 3 part process. A trigger, condition, and an action. If a condition is not met, then don't take action. 

 

Perhaps, you can break your automation into another rule. Basically, the 2nd rule would be trigger by a comment. If there isn't one, don't proceed. If there is one, compare it against some pattern to indicate that it's the comment from the description and not a regular comment.

TAGS
AUG Leaders

Atlassian Community Events