Hi everyone!
I'm looking for a way to add assets to the assets object field. I have tried several things, but they didn't seem to work or my formatting wasn't great (JSON, Smart values).
The reason I want the assets to be added to the asset object field is because we do our asset management (phones, tablets, laptops) in Assets. We lease all these devices so it is important to know sometime beforehand when the lease on these devices ends.
For that reason I created an automation with an AQL that is scheduled for the 1st of the month that says 90d before the lease end date to create an issue with the list of devices that will breach the end date within the following 90d.
This works pretty great and I am able to paste the list of devices in the description. We only want to make it simpler since now you have to paste all the serial numbers and input them in Jira Assets. If we could add the assets to the assets object field we could cut that time in half and click instantly to the device in question.
Any ideas to tackle this are welcome!
First thing, I am not using the assets features of Jira, and so my suggestions are based on what I know of automation rules. With that out of the way...
From what you describe, you paste information into the Description field of a Jira issue, using that to then create assets. Now you want to paste in more information for each created asset. Is that correct?
If so, I recommend using a defined / fixed format for the information you paste into the description. That will make it easier to parse the data.
Next, try doing this by adding one attribute at a time, testing and improving as you go.
Finally, this will most likely need to be implemented using advanced edit with JSON (or calling the REST API functions). I recommend pre-building the JSON in created variables, and writing it to the audit log to assess it matches what you expect. That will also fully expand the JSON before used in the edit action...and so prevent any JSON parsing errors.
Kind regards,
Bill
Hi @Bill Sheboy ,
Thanks for your response.
I'm trying to directly get the assets found with the AQL out of Jira Assets and paste them into the assets custom field with an automation.
I have been trying your last recommendation, the advanced edit with JSON, but I don't see enough documentation about adding objects through JSON. It could also be possible that this isn't present yet since the Advanced Editing documentation has no mention of objects from Jira Asset.
Anyway, I'll keep trying to make it work and otherwise I think having the Name of objects pasted into an issue description isn't that bad either.
Kind regards,
Damian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry I am not able to help more, Damian. I did a bit of research and was unable to find more information on specifics of JSON edit for assets in the documentation. And the example rules on JSM usage in the template library are quite sparse.
At this point, I recommend you submit a ticket to Atlassian Support for assistance. You are the site admin for a paid license, and so can do that here: 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.
Thanks for your response.
I will submit a ticket to Atlassian Support and see what they may come up with.
Afterwards I'll try and make a post or something of that matter so others can try to do it as well!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Damian de Vries
have you found a solution to your question? I am also trying to update an Assets object custom field in Jira using automation, but I can't seem to find a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Muhammed Volkan Haralali ,
For the adding to the custom field section I haven't really found an answer except for me doing it entirely different.
What I did is instead of populating the custom field, I poured all the data into an Jira issue.
It's less pretty, but it still creates a list of things. So as of now all I know is that you can paste the display text in a text (custom) field.
If I ever find something that works I'll update this question, but I don't think there's a way now to create something like this. Perhaps it's possible with scriptrunner, but I'm again, not entirely sure😅
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Damian de Vries ,
After much tinkering with JSON I have managed to update the Assets custom field with the help of smartvalues. Basically my automation does the following:
It collects a list of Assets object with the help of lookup.
It then adds these items to the Assets custom field.
The Assets lookup function I use here is from Scriptrunner since I am working in a Data Center environment.
The part that did the trick was to format the Assets objects as JSON objects and using the JSON syntax to generate a list based on the smart value.
I am adding a screenshot of my Advanced Edit action and some useful links:
Assets with Jira REST API | Atlassian Support | Atlassian Documentation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Muhammed Volkan Haralali ,
Thanks for your message!
I will try and see what I can do with this.
We are using the Cloud instance and sadly don't have scriptrunner.
Seriously well done with finding the solution, I'm impressed!
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.