Forums

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

Jira automation rule to match asset value then compare and create

Shi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2025

Hi everyone 

I’ve created an automation where, when a user creates an issue and enters a device name in a custom field, the automation checks the IT hardware asset sheet for a matching device name.

  • If the device name matches an existing asset, the automation simply adds a comment saying the device name matches and takes no further action.

  • If the device name does not match, the automation creates a new asset record with that device name.

My current challenge is adding a condition to validate the device name format. For example, if the device name entered doesn’t follow the required pattern (like starting with “ABC” followed by digits, e.g., ABC1245), the automation should fail, notify the user that the device name is invalid, and not create a new asset.

I’m struggling to design the correct structure using “If → Else” conditions to make this work properly.

 

this: is the condition 
{{issue.customfield_xxxx.trim.match("^ABS\\d{5}$")}}

would be much grateful for any ideas I can write down the whole structure i have 

 

 

StepActionDetails
TriggerIssue Created or Field ChangedDevice name field
ActionLookup rows/issuesFilter: deviceName = {{issue.fields.deviceName}}
Condition (if/else)If lookup count > 0Device exists → Do nothing or comment
ElseCreate assetUse device name from issue
 Add comment"New asset created with name: ..."

 

2 answers

2 votes
arielei
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 17, 2025

Hello @Shi 

Dont struggle with it, do the following:
Set a validation on the Name attribute in your asset object using regex.
Then use your automation to check if it was able to create the object, and if not, send a message to the requester.

 

much more simple and clear.

Trudy Claspill
Community Champion
July 17, 2025

@arielei 

That won't work.

When the validation fails and the object can't be created, that will cause an error to occur in the rule and none of the steps after that will be executed.Screenshot 2025-07-17 at 1.27.58 PM.pngScreenshot 2025-07-17 at 1.27.43 PM.png

0 votes
Trudy Claspill
Community Champion
July 17, 2025

Hello @Shi 

Welcome to the Atlassian community.

I recommend that you use an Else-if to validate the name provided in the issue against a regex. If the name is acceptable, execute the Create Object action. Then the final Else handles reporting that the name was invalid.

Screenshot 2025-07-17 at 1.40.04 PM.png

Shi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 17, 2025

That’s strange I am not able to see more than one else in an IF branch - so using IF or else 

gives me only one else and this is my main problem I wonder if this is the license am using? 

Trudy Claspill
Community Champion
July 17, 2025

No, there is no difference in this functionality based on the license.

Can you provide a screen image of what you see?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events