Hello everyone
I have a case from user:
When we put in a URL link in to text custom fields we want's to automaticly update a few customefield in triggered task from url task.
When a creater a automation i have a problem with data from url.
To search issueKey in url:
1. Create variable with value:
{{issue.customfield_xyz.match("selectedIssue=([A-Z]+-\d+)")}}
2.Lookup Issues with JQL issuekey = "{{issue.issuekeyFromUrl}}"
3. Edit issue
but always a get a error : "Custom Smart Value JQL Search: “(issuekey = ‘’) AND (project in (xyz))”. - Report key “” for field 'issuekey' is incorrect." so value is blank.
At the next step i was try:
1. Lookup Issues with JQL issuekey = {{issue.customfield_xyz.match("selectedIssue=([A-Z]+-\d+)")}}
2. Edit issue
I get a message with confirm automation but value in issue was blank
I don't know where is a problem.
Maybe someone had a similar problem and knows how to deal with it?
Hi @Patryk Kowalczyk -- Welcome to the Atlassian Community!
For a question like this, context is important for the community to help. Please post the following:
Until we see those...
When using a created variable, such as named issuekeyFromUrl, that is referenced alone and without an issue prefix. For example as:
{{issueKeyFromUrl}}
Next, I recommend adding a write to the audit log to confirm the URL and variable value contain what you expect:
https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Log-action
Kind regards,
Bill
Thank you for the additional information.
When responding, please stay in one conversation thread. That will help others reading this question in the future know if there are multiple possible answers. Thanks!
Please re-read what I posted above, as your rule's JQL is still incorrect. It should be this:
key = {{issuekeyFromUrl}}
Also, if that variable {{issuekeyFromUrl}} is empty, the field did not match your regular expression.
Please post an example of a value from customfield_10353 (the field checked by the match function) to help compare to the regular expression.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay so I was read one more time posted about rule's JQL.
You have right, I was had a mistake in function so I correct this.
In next step I have changed my apporach and start use substringAfter function instead of .match.
I added options to the function with the addition of a comment to check what value of a variable I get with a given function
This is a flow of my new automation function:
In event log I get a success status, but fileds don't complement each other according to automation.
Comment who I add look like
And result
Example of a value from customfield_10353 is in TestString2
Is there an error in my thinking somewhere here?
It seems to me that the function {{issue.customfield_10353.substringAfter("/browse/")}} should only return “DEW-1302” and then this should be retrieved by automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please use the Log action to write test expressions to the Audit Log, rather than adding comments. When comments are added, formatting is modified / interpreted, and makes diagnosing rule problems more difficult.
https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Log-action
This is one reason I asked you to paste a value from that field directly in your message response and to write it to the audit log.
If the value in the field is a smart link, the issue key is likely in the text twice, and so must be parsed accordingly. For example, the field may contain this:
[yourJiraURL/browse/DEW-1302|yourJiraURL/browse/DEW-1302]
In that case, you could get just one key like this:
{{issue.customfield_10353.match("([A-Z]+-\d+)").first}}
or
{{issue.customfield_10353.substringAfterLast("/").substringBefore("]")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your advice.
I added the audit log action to my automation and got interesting findings.
The problem is not with the smart value, but with the search function.
The automation cannot find any problem with my key.
I added permissions for the jira automation user to the project where the issue being searched is, but it still doesn't work.
(The issue being searched for is in a different project than the trigger issue).
Additionally, I tried adding “PROJECT IN(”DEW")” to my JQL issue search, but the effect is the same.
Maybe I should use another function to search for the problem in another project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just a thought...Is the automation rule setup for multi-project or global?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The rule is configured for a specific project and gives the automation user permissions to another project, which is a potential search
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Understand but it may be that, in order to reference an issue in another project the rule needs to be multi-project. I have never tried this previously. Can you try this? Alternatively as a test try referencing an issue in the same project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Bill Sheboy for instruction!
Now i put missing information:
Project is company - managed
First versionwas very simple:
In audit log I was get a sucess status but data have not complemented each other.
In my opinion this shoulde found a issue with issueKey and completed this fields.
Second version with new created variable:
And here i get errors "Unable to run the search while custom values were being defined: ."
Probably variable don't have value but i don't know why
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.