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
| Step | Action | Details |
|---|
| Trigger | Issue Created or Field Changed | Device name field |
| Action | Lookup rows/issues | Filter: deviceName = {{issue.fields.deviceName}} |
| Condition (if/else) | If lookup count > 0 | Device exists → Do nothing or comment |
| Else | Create asset | Use device name from issue |
| | Add comment | "New asset created with name: ..." |