In asset management, I have an object type "Customer's Contact" with an attribute called "mail." I've attempted to create an automation rule that retrieves this mail, creates a customer in my JSM Portal, and adds the new customer to the new object's attribute (specifically, an attribute called "JSM User").
I'm using REST API requests for both actions. I can successfully create the users and retrieve the account ID. However, when I try to update the attribute, it doesn't work. It seems that these two actions cannot occur within a single automation rule.
I think that because when I split it into two different rules, it works well(I can update the object's attribute correctly using a PUT web request).
so, for now, this is my workaround: the first rule creates the users, and the second rule looks for new objects once an hour and updates their attributes.
first rule : attached in screenshot
second rule: (lookup object looks for all the empty "JSM Customer" attributes.
then, using GET method ,send web request: orgURL.atlassian.net/rest/api/3/user/search?query={{ObjectsList.mail}}
then, using PUT method, send web request to update the customer in the object's attribute:
https://api.atlassian.com/jsm/assets/workspace/WorkspaceNumber/v1/object/{{ObjectList.key}} with custom data : { "attributes":[ { "objectTypeAttributeId":"81", "objectAttributeValues": [ { "value":"{{webResponse.body.accountId}}" } ] }
Does anyone have ideas on how to make this work in a single rule?
@Yossi Avissar , Welcome to the Atlassian Community!
Have you tried using a delay between these actions?
What may be happening is that events within the same rule are executed at very small intervals to ensure that your next action was able to correctly retrieve the information processed by the previous action.
Try adding a Delay action and setting it to something like 1 minute between some key actions in your process. Or if applicable, use re-fetch to ensure that the rule will try to pull data saved in the previous action.
Some of these suggestions should help you keep everything working under the same rule.
If the problem persists, let us know.
KR,
Fernando
Hey @Fernando Eugênio da Silva
Thanks a lot for your answer!!
I'm pretty sure that when I wrote this post, this feature didn't exist.
anyway - it works!
To sum-up the solution :
insert this Delay action before the GET web request :
30 seconds should be enough.
and that's it.
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.