I've been having an issue with getting an automation to consistently set a field on an Asset object record. I've looked over many posts here, checked documentation, etc. but for some reason I still can't get the automation to work properly and give me consistent results.
Essentially what I'm doing is a use case that comes up often here, associating a Jira User account to an Asset object, in this case users also imported from Entra ID. I have the Asset schema set up with the necessary attributes and everything imports fine.'
Now when I go to set up the automation however, this is where the issues come in. Below is the current configuration that I have, after following posts and guides that I've read. For this specific automation, I'm trying to update my own user record in assets so that I can ensure that it's updating at least one record correctly.
Step 1: Currently scheduled every hour but allows me to run on demand to test.
Step 2: AQL to find the object with a specific E-mail Address
Step 3: Log the object E-mail Address so that I can confirm what is being passed into the web request
Step 4: Send the web request using the object."E-mail Address"
This is where things start to have issues, I think. If I plug the web request into a browser, it returns what I'm expecting:
I try to log the webResponse to the audit log so I can see what is returned, but no matter what I've entered here I seem to get an empty response. I've tried using {{webResponse.body}}, {{webResponse.body.accountId}}, and just {{webResponse}}, and the only time anything shows in the logs is for {{webResponse}}.
Audit log:
Step 6: Now if the web response would actually return properly, the comparison for the webResponse would happen here.
Step 7: This should be able to take the web response and parse it to find the values I need and use that to set fields on the asset, but this is not happening.
I'm sure I'm missing something here that should be obvious, but I'm not sure what that is. Any help is appreciated.
I notice your Send Web Request action has the option checked to keep processing even when not successful, but your rule does not check {{webResponse.status}} to confirm the call succeeded. This may be why the log shows the response body is empty: the call did not succeed.
Next, I have observed timing problems with the Send Web Request action when smart values are used in the URL or custom data. I have read other posts where this is worsened when the source is from an asset. Perhaps try using a Created Variable to first build the URL and then use that fully evaluated one as the action's URL.
Kind regards,
Bill
I added a logging step for the status, and it returns 200.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up changing the logging to {{webResponse}} and get something back, but do see that the body does return as [ ]
I'm not sure why the exact same URL will return a non-empty array if I plug it into a browser, but not when done via Automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tried a similar rule (without assets) with single and wildcard email addresses in a variable and it worked as expected.
Back to my second hypothesis, this may be a timing problem with asset data. Please try this:
This will force the URL to be fully evaluated before usage, and you can log it to confirm it contains what is expected. And if it does, this will fault isolate the problem to the call / response, rather than the query data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy for the ideas. So, what I think is happening based on the latest audit log is:
I've tried also adding delays between steps, but the result is the same each time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very curious...let's try this:
Also, I just noted you are using version 2 of the endpoint rather than the latest version 3. Perhaps try changing to that version:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've updated to API version 3 as well, but the same result is returned. Even when hardcoded with my email address the webResponse body is an empty array.
I validated the configuration and got the following results:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This seems to indicate an authorization / access problem:
You earlier tested with a browser (which uses your Jira credentials when logged-in) and received the record, but when hardcoding a URL in the rule there was no result.
Please confirm, or regenerate your API token, for a user with access, re-enter it in the action, and re-test.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I generated a new API token for my user account and have tried to use that in the automation. The web request passes validation but still has an empty array as a response.
I also tried to update the Actor of the automation from "Automation for Jira" to my own user account. Again, this validates the web request, but nothing is ever actually returned.
I then deleted the header completely and created it new with the new API token, and the result was also the same.
As it is now, I'm kind of at a loss as to what could be preventing values from being returned in the web request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've checked a few other automations that are supposed to be updating Asset records, and none appear to return anything in the web response. I don't know if it's all inter-related because it's for Assets, but I'm certainly not getting any returns via automations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, one more thing to try before contacting the support team...
Automation rules can sometimes get "glitched" behind the scenes, corrupting their stored JSON, thus causing unusual symptoms. The exact repro steps are not well defined, and may happen when a rule is edited too many times or has corrupted, stored connection data.
The way to check for that cause is:
Given you described other rules have the symptom, this may not resolve it. This rule is correctly returning the asset data (so not a rule scope problem) and the user lookup is returning no information for the user search endpoint when called from a rule. Without seeing them, the other asset-related rules could still have scoping problems.
At this point, please work with your Jira Site Admin to submit a ticket to Atlassian Support.
https://support.atlassian.com/contact/#/
When you hear back from them, please post what you learn to benefit the community. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new rule from scratch and the same problem occurs each time where the web response body is empty, but only when done via an automation rule.
I'm going to open a help ticket and see what support has to say.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy thanks again for all your help and time with this. I really do appreciate it.
I was able to get this working now. I ended up sending the web request in an In Private browser session, and that returned an empty array as well. Once I saw that was the case, I decided to do the following:
Once I did this my web request returns were populated if the query found anything.
I still have issues with the rule failing occasionally for no apparent reason, so I'm going to work on making the logging more robust, so it'll be easier to pinpoint where an issue is when there is a failure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.