Hi,
from an application I receive a list, either as csv file or just a list to copy to your clipboard. For all assets within that list, I want to edit an user attribute from those assets to the reporter.
To process that csv list with automation, you need to send a Web Request and handle the attribute update via API.
I want to do it only within automation, so I have a request type with only a custom field which is a multi line text field. So from my application, I copy the list which looks for example like:
"ITAM-1
ITAM-2
ITAM-3"
My automation rule looks like this
So from my understanding, this advanced branching should handle every line within the list seperately and for each assetKey in the list, lookup that object and edit my attribute to the issues reporter.
The audit log looks like this
Does anyone has a tip for me how to handle this correctly?
Thanks in advance
2 things to note (as per the documentation): https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Edit-object
1. To use the Edit Object action, you need to use the AQL branching.
2. It won't work with the Lookup objects action
You can try the below setup to see if it works:
Hope this helps.
thanks for your reply!
Can you tell me how to refer correctly to the WebHook Elements?
The first rule is handing over the correct values in the headers:
In the second Automation Rule, i tried to refer to them with
{{webResponse.headers.assetKey}},
{{webhookData.headers.assetKey}},
{{webhookData.header.assetKey}},
{{webhookData.assetKey}}
I added those variables to the log within the second Automation Rule to see if they have a value but unfortunately they stay empty:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the "Log Action" try printing {{webhookData}} directly, this will show you the complete JSON data that is being sent to the other automation. Please can share that here once printed, will be able to help with the syntax then. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the {{webhookData}} Output:
As webhookData.headers didn't work, I now tried {{webhookData.fields.customfield_10219}} / {{webhookData.customfield_10219}} as assetKeys and {{webhookData.displayName}} / {{webhookData.fields.displayName}} / {{webhookData.fields.reporter}} as Reporter but my variables are still empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marius Fassbender ,
The output in the Log Action has been trimmed, due to it's length.
What I would suggest to change in your original automation, is to trigger a Web Request for each asset available(1), and change the request body to "Web request body" to Custom(2). Adding attachments below:
1.
2.
In the Custom body send only the CURRENT assetID, this Asset ID can then be used in the next automation, as reference to a AQL branch which should make your "Edit Object" action work correctly.
Hope this works :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sending my values as custom data did the trick. I can refer those now as {{webhookData.*Custom data*}} in my 2nd automation so it finally works now.
I still send all the Asset-ID's from my custom field at once, but with the Branch AQL statement "IN" for going through all those ID's it works.
Thank you very much @Jehan Bhathena for helping me out with that!! :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to know it works now.
Cheers 🥂
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.