Forums

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

How to copy asset value from insight to custom field in jira issue

Piotr Mańkowski July 6, 2023

Hi!

Is it possible to create automation or any other solution to schema like I need copy asset attribute value ( like Serial Number ) from insight to custom field in jira?

1. When Create issue

2. Have custom field in issue for asset like this:

Screenshot 2023-07-06 at 17.15.10.png

3. Automation copy value of attribute "Serial Number" From Object "LAPTOP" and insight name "RZM ASSETS" of reporter issue to custom field "Komputer" in Jira issue

Screenshot 2023-07-06 at 17.18.24.png

 

Tried many times but cant or don't know how to put value of attributes from object in insight to custom field in jira

1 answer

1 accepted

1 vote
Answer accepted
Mikael Sandberg
Community Champion
July 6, 2023

Hi @Piotr Mańkowski,

Welcome to Atlassian Community!

Yes, it is possible to copy attributes from an object to a custom field if needed. But you could also use the assets field, which Komputer is, and configure it to show more data then just the name of the object.  

Piotr Mańkowski July 6, 2023

Hi @Mikael Sandberg 

Thank you for quick reply. I know i can configure this field for more values but could you prepare or show me how to create automation which copy value to this field?

Mikael Sandberg
Community Champion
July 6, 2023

Here's an example that gets approvers from our Peoples schema.

Screenshot 2023-07-06 at 9.08.09 AM.png

All you have to do is a lookup object and then use that to get the attributes you are looking for.

Piotr Mańkowski July 6, 2023

@Mikael Sandberg  still have error :(

Screenshot 2023-07-06 at 19.12.52.png

could you build new automation with these parameters?

Schema: RZM ASSETS

Query: LAPTOP

Attributes: Serial Number

Put Serial Number value to custom asset field "Komputer" in Issue ( from Reporter )

 

Screenshot 2023-07-06 at 19.13.36.png

Mikael Sandberg
Community Champion
July 6, 2023

The error indicate that your AQL is not configured the right way, what does it look like?

Based on the info you provided above the AQL would look something like this:

objectType = LAPTOP AND "Serial Number" LIKE (<enter the number here>)

Where are you getting the serial number from? Is that on the request form? If you for example wanted to get the laptop for the reporter the AQL would look something like this:

objectType = LAPTOP AND Owner = {{issue.reporter}}

This assumes that the Owner attribute is set to user type.

Piotr Mańkowski July 7, 2023

@Mikael SandbergStill can't do that or maybe i have incorrect config of AQL.

This is my automation -> We need copy from insight serial number of laptop which is assign for issue reporter and put into field "Komputer" ( could you give me correct value in automation?  )

Screenshot 2023-07-07 at 12.19.15.pngScreenshot 2023-07-07 at 12.19.26.pngScreenshot 2023-07-07 at 12.19.36.png

 

Issue with custom field (maybe i need to switch for text field not insight field?) and parameters

Screenshot 2023-07-07 at 12.20.04.pngScreenshot 2023-07-07 at 12.21.11.png

 

Insight fields and value:

Screenshot 2023-07-07 at 12.23.36.png

Mikael Sandberg
Community Champion
July 7, 2023

Okay, based on your screenshot for the lookup component the AQL is incomplete. So lets start there. Is serial number entered when the request is created? Or is your only reference to the object the reporter? Since Komputer is an asset object field you do not have to do a lookup, you can just use the edit issue component in order to set it like this:

Screenshot 2023-07-07 at 8.50.54 AM.png

This will set Komputer to all the objects that are found in the LAPTOP object type where the assigned to corresponds to the reporter. That way you cover the scenario where the reporter has multiple laptops.

You only have to do the lookup object if you would extract data from the object and use that in a field that is not an asset object or if you are doing other things based on the attributes of the object. One example of this is how I use department objects in order to set the approvers field based on the selected department (department is a custom single select field).  

Piotr Mańkowski July 7, 2023

Is serial number entered when the request is created? // Nope, i wanna be set up this later.

 

 

This will set Komputer to all the objects that are found in the LAPTOP object type where the assigned to corresponds to the reporter. That way you cover the scenario where the reporter has multiple laptops.

You only have to do the lookup object if you would extract data from the object and use that in a field that is not an asset object or if you are doing other things based on the attributes of the object. One example of this is how I use department objects in order to set the approvers field based on the selected department (department is a custom single select field). // Seems legit but still have error :( could you prepare this automation from the start to end with screenshots of field (standard not insight as u said )and insight?

Mikael Sandberg
Community Champion
July 7, 2023

So for the scenario when you set the asset object field the previous screenshot covers that, just add the initial trigger which could be when the issue is created. For the case when you are copying attributes to a text field, in this case I am using the description field, it would look something like this:

Screenshot 2023-07-07 at 9.20.47 AM.png

Screenshot 2023-07-07 at 9.20.59 AM.png

Screenshot 2023-07-07 at 9.24.22 AM.png

Screenshot 2023-07-07 at 9.24.35 AM.png

Screenshot 2023-07-07 at 9.33.12 AM.png

Note that I am using a global smart value in order to cover the case where the reporter has multiple assets assigned to them. If they are only assigned to a single one then the branch is not needed and you could just use {{lookupObjects."Serial number"}} to set the custom field.

Piotr Mańkowski July 10, 2023

Thank you!

Like Mikael Sandberg likes this

Suggest an answer

Log in or Sign up to answer