Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Retrieving an attribute value from an Assets field

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2023

Hi,

So I have some object with a "group" attribute.

I'm trying to retrieve (thru automation on Datacenter) the value of this group attribute to store it in a (multi) group picker.

Right now when I Log the {{customfield_xxxx}} value it does return my object label and key like "Test (Ci-123)" however trying to get an attribute value never seems to output anything.

My attribute name is "User Group" and i've tried

  • {{customfield_xxxx.User Group}}
  • {{customfield_xxxx.[User Group]}}
  • {{issue.customfield_xxxx.User Group}}
  • {{issue.customfield_xxxx.[User Group]}}

 

but the output remains empty.

It seems that on Cloud i can get some more details but on DC I just can't seem to find the syntax. 

Anybody got an idea?

2 answers

0 votes
Mauricio Heberle
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.
September 11, 2023

You could try for example creating a var with the value

issue.custom_field.user group

store it and send it to the other field you want.

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Hey @Mauricio Heberle ,

That's a possibility, the problem is that getting the value of the field (meaning the attribute of the Asset object on the Asset field) always returns blank.

Mauricio Heberle
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.
September 11, 2023

Even if the group attribute is filled? I believe it should return the group id thats added in the object attribute

0 votes
Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2023

Hi @Dirk Ronsmans

I am not sure if you have tried {{customfield_xxxx"User Group"}}.

Can you share a screenshot of the User Group attributes. Assuming it's not a reference towards an Group object type. 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

I had not tried that syntax yet, but unfortunately it gives the same result. 

Just a blank output.

This is my current object definition.

2023-09-11 11_41_24-Assets - Jira ServiceDesk - TEST.png

Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Hi @Dirk Ronsmans

Within DC it looks like the User Group is actually a reference to the actual groups a user is a member of. In Cloud you can use the Group information but it's not Automatically added. 

However, in this case you can use the IF/ELSE statement in Automation with a check if a user is part of a group. Unless somebody knows how the Group information can be retrieved within a custom field that is referencing object information that is referencing the groups in Jira. 

Screenshot 2023-09-11 at 12.48.22.png

In my case (in Coud) I can reference that customfield by the previous example I gave. 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Well it's an Asset so the "Group" type attribute just links to all available Groups in the group management. Nothing to do with whether a user is member of it or not.

I guess we just have different use cases.

For me I want to get the value of the "Group" attribute and set it on a multi group picker field on an issue. Meaning if you select the Asset object on the issue it will fill the group picker on the issue with the same value.

 

Guess I'll have to switch to good old Scriptrunner for this one

Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

So you are saying that the Group is not pre-filed in the Object itself and therefore the same as with Cloud (not linked to the actual groups)? 

 

Screenshot 2023-09-11 at 13.00.36.png

 

Screenshot 2023-09-11 at 13.00.49.png

If that's the same as with Cloud (a multigroup picker) than my reference should work but just needs the correct naming. Your object should then look like this (with no pre-filled group). 

Screenshot 2023-09-11 at 13.04.23.png

If so. If I want to see the Groups within a customfield value I use {{customfield_xxxx"User Group"}}. Let me know if you see a value pre-populated or not. If you do than you will need a different approach (with or without SR). 

Dirk Ronsmans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

We do pre-populate the value in Assets.

e.g.

We have a group in Assets called Service Desk, the "User Group" Attribute is maybe "SD_L1"

SD_L1 is an actual Jira group with Jira Users in it.

On an Incident/Issue I select "Service Desk" from my Assets custom field and I want a different custom field (which is a group picker field) on the same issue to get the value SD_L1 (based on the value we retrieve from Assets)

Problem now is that I can't seem to get the SD_L1 value from the Assets object if I run an automation on the issue. It's always blank.

 

Hopefully that makes it more clear?

Wouter van den Berg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Correct me if I am wrong but you have two Custom Fields: 

  1. The Asset object customfield 
  2. Group picker customfield

If you want to copy the value of the Asset custom field to a Group picker custom field then you need to create a variable and catch {{Assetcustomfield_xxx"User Group"}} and then Edit Issue, Customfield Group picker. 

Having a customfield that's not an asset object custom field does not allow for directly injecting asset information. Hope this makes sense. 

If that Group picker is an Asset Object field then the previous suggestion should work and since it doesn't I am assuming it's not a Asset custom field. 

Let me know. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events