Forgive the unhelpful summary/question. There are a lot of aspects to this, and I've tried as many tricks as I can think of.
--------
I have six rules in place that extract specific data from the description of a ticket (the tickets are created by an external app), and then place the info (urls) into custom fields for the purpose. We cannot control where the app puts the data, so it's all just part of the description and Jira automation does the processing.
One of the rules (only one, which is strange because they're clones of each other) fails unless a user edits the ticket, in which case the rule works correctly. If automation triggers the same rule or the "Create" version of the rule, it will fail to extract the data and will just empty the field (fills with whitespace I suppose)
The rules work like this:
CREATE rule
Trigger: Issue Create
(Conditions based on Issuetype and a required label)
Actions:
-create a variable using {{issue.description.substringBetween("Url:*","*UniqueIdentifyingText:")}}
-create a new variable with junk removed from the first variable (formatting causes issues, so I'm stripping the formatting using a series of {{MyVariable.remove("*")}} actions.
- (logs the variables to the audit log at every step, so I can make sure the processing works)
- ...repeat as needed
Finally, take the final variable content and add it to my short-text field.
EDIT rule (this is a clone of the other rule with the trigger changed. This is a required rule because our external app will sometimes update the description, and we need to know the new URL)
Trigger: Edit Description field (for all issue operations except create)
(Conditions based on Issuetype and a required label)
Actions:
-create a variable using {{issue.description.substringBetween("Url:*","*Text:")}}
-create a new variable with junk removed from the first variable (formatting causes issues, so I'm stripping the formatting)
- (logs the variables to the audit log at every step, so I can make sure the processing works)
Finally, take the final variable content and add it to my short-text field.
There are 3 sets of these rules, one set for each of the URLs the external app provides us in the description. TWO of the three rules work correctly in every case, but one does not (the github one)
So, when the external app creates a new ticket, 2 of the 3 "URL" fields are extracted correctly (they're short text fields, not the actual URL custom field)
The last one will always fail. If I then manually edit the description field in any way, the EDIT version of the rule will successfully run and I get my last URL.
If I set up that Edit rule to run when triggered by another rule, it will claim success but will empty the final URL field. If I set up a rule to to manually edit the description, the rule will still fail.
TLDR, there is a meaningful difference between automation editing the Description (in any way), and a user editing the description manually.
Does anyone have any suggestions? The information inside the rule is sensitive, so I can't post the actual audit messages here, but if needed I can obscure that info and post them. Just wanted to see if anyone has a "oh you forgot _____" suggestion before I do that.