My main goal is to be able to retrieve the information that is displayed on the user profile in Jira and apply those values within a Jira ticket, so when a ticket is created, this info is auto-populated in assigned custom fields. However, despite our Jira Cloud being synced with AzureAD, this info is not retrievable through automation. An alternative found way is through API.
I have created an Automation that basically does the below:
When: Issue is created
Then: Create Variable
AND: Send Web Request
AND: Create variable
AND: Send Web Request
AND: Add value to the audit log.
AND: Edit issue - Jobtitletest: {{webhookResponse.body.jobTitle}}
The automation runs successfull, but unfortunately it populates the customfield with literally the value "{{webhookResponse.body.jobTitle}}". The expected result was that it would retrieve the jobtitle from the webhook's response body, but it didn't. How can I achieve this? Again to reiterate, my goal is to map the user info that you can see in the User Profile within Jira, to custom fields within a ticket, every time a ticket gets created within the ITSD project. I do not want to use third party apps of any kind because we don't have the budget for that. Please help and apologies in advance if I didn't explain properly.
As you are showing a manually typed in version of your rule, versus images of the rule and audit log, the community will need to guess a bit in order to help...
In the rule you describe, you write this value to the audit log in the second-to-last step:
AND: Add value to the audit log.
- Log message: {{webhookResponse.body}}
Does that write to the audit log contain what you expect?
Next, you state that Edit Issue action at the end of the rule, apparently of the field Jobtitletest, is writing the smart value expression rather than the value of that expression. Have you confirmed that smart value expression is correct and has no typographical errors?
Kind regards,
Bill
Hello @Bill Sheboy ,
Apologies for that. I didn't think the screenshot would contain sufficient info or would be sufficient:
To answer your question, the second to last option (adding value to the audit log) does bring a result, but actually shows the Access Token instead of what I expected.
Regarding your last question, i had found documentation that this was possible, but I am not able to find it any more. Not sure if this idea was a fever dream or exhaustion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information to confirm the rule structure.
The Issue Created trigger can fire so quickly that some information may not be available to the rule yet. I recommend adding the Re-fetch Issue immediately after the trigger to prevent any timing problems with it.
Next, do each of your Send Web Request actions have the option enabled to wait until the response occurs? It is this checkbox: "Delay execution of subsequent rule actions until we've received a response..."
Finally, I wonder if {{webhookResponse.body.jobTitle}} in your Edit Issue action is not parsing correctly, particularly if the rule is not recognizing it as well-formed JSON. That can be confirmed by also writing just that expression to the log. The workaround may be to use the match() function with a regular expression to parse the body: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Bill,
I think the re-fetch issue did trick combined with the "Delay execution" which was not active for the second Web Request. The logged actions now display the right options and the field is populated correctly now.
This opens up a lot of possibilities for now. Much obliged!
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.