Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Automation not setting Asset field value

Marcel Hager
Contributor
June 13, 2025

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 1.jpg

Step 2: AQL to find the object with a specific E-mail Address

Step 2.jpg

Step 3: Log the object E-mail Address so that I can confirm what is being passed into the web request

Step 3.jpg

Step 4: Send the web request using the object."E-mail Address"

Step 4.jpg

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:

Web request.jpg

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}}.

Step 5.jpg

Audit log:

Audit log.jpg

Step 6: Now if the web response would actually return properly, the comparison for the webResponse would happen here.

Step 6.jpg

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.

Edit object.jpg

 

I'm sure I'm missing something here that should be obvious, but I'm not sure what that is. Any help is appreciated.

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2025

Hi @Marcel Hager 

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

Marcel Hager
Contributor
June 13, 2025

I added a logging step for the status, and it returns 200.

Web response status.jpg

Marcel Hager
Contributor
June 13, 2025

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.

Web request 2.jpg

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2025

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:

  • create variable:
    • variable name: varURL
    • smart value: your full URL with the object smart value added
  • send web request:
    • using {{varURL}} as the Web Request URL

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.

 

Like Marcel Hager likes this
Marcel Hager
Contributor
June 13, 2025

Thanks @Bill Sheboy for the ideas. So, what I think is happening based on the latest audit log is:

  1. AQL queries an object with a specific email address (my own)
  2. Value for {{object."E-mail Address"}} is logged and is the expected value
  3. Then the variable {{varURL}} is created with the web address that resolves when used in a browser
  4. The {{varURL}} variable is logged and does appear to be correctly formed as expected
  5. Web request is sent with {{varURL}} as the web request URL. This step is also set to delay execution until the response from the request is received
  6. {{webResponse.status}} is logged and shows 200, so should be successful
  7. {{webResponse.headers}} are returned
  8. {{webResponse.body}} returns nothing in the logs
  9. Automation stops here because the comparison step for {{webResponse.body.size}} won't be equal to 1 (I think)

Audit log 2.jpg

I've tried also adding delays between steps, but the result is the same each time.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2025

Very curious...let's try this:

  • copy your Send Web Request action so we can do a temporary test
  • hardcode that URL in the Send Web Request action for a specific email address
  • at the bottom of the action, select "Validate your web request configuration"
  • select "Validate" to run it
  • this will check if the headers / token you are using will indeed return the expected results in the response
  • when done testing, delete that copy of the Send Web Request action

 

Also, I just noted you are using version 2 of the endpoint rather than the latest version 3.  Perhaps try changing to that version: 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get

 

Marcel Hager
Contributor
June 13, 2025

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:

Web auth.jpg

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2025

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.

Marcel Hager
Contributor
June 13, 2025

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.

Marcel Hager
Contributor
June 13, 2025

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.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2025

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:

  • disable your current rule
  • re-create it from scratch
  • enable it
  • test the new rule

 

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!

Like Laurie Sciutti likes this
Marcel Hager
Contributor
June 16, 2025

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.

Like Bill Sheboy likes this
Marcel Hager
Contributor
June 16, 2025

@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:

  • Delete my automation rule
  • Create new version of rule
  • Create a new API Token
  • Encode my user email address and API token to Base64
  • Set up Authorization header with new encoded string

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.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events