Forums

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

Lookup Asset, then get a referenced objektType Name

Tarik Userli
Contributor
April 3, 2025

Hello,

i have a objektType called "Software", there is all our Software listed with attributes like

  • Name
  • Vendor
  • Software lead
  • Team

The "Team" attribute is another objektType with all of our Teams ("zuständies Team") with attributes like

  • Name
  • Lead
  • Members
  • etc

Now my issue is, if i want to get the Team Name via lookup inside the Automation i just get back the key but not the name. 

 

my steps are:

Lookup Asset (Insight) object with ScriptRunner

-> {{issue.customfield_13821.key}} - customfield with the referenced Software

for troubleshooting: Comment on issue 

  • Objekt Key: {{issue.customfield_13821.key}} - Works
  • Objektname: {{lookupAsset.objectType.Name}}
  • Team: {{lookupAsset.attributes.zuständiges Team.Name}}
  • Team: {{lookupAsset.attributes.zuständiges Team}}
  • Fachbereich: {{lookupAsset.attributes.Fachbereich}}

 

My commments show me this:

Objekt Key: ITA-80844

Objektname: Software
Team:
Team: 56885
Fachbereich: KAS-KHBA-KLK: KIS

{Name=CGM Medico, Status=30, Fachbereich=KAS-KHBA-KLK: KIS, Hersteller=80945, Kategorie=Anwendung, zuständiges Team=56885}

 

So i just get the key but not the name from my Object.

 

And i cant get the key in any ways.

3 answers

1 accepted

4 votes
Answer accepted
Tarik Userli
Contributor
April 4, 2025 edited

Got it by myself.

For all who want to do the same:

Automation:

  • Lookup Asset (Insight) object with ScriptRunner
    • {{issue.customfield_XXXXX.key}}
  • Create variable

    • Variable name - NameYourVariable
    • Smart value - {{lookupAsset.attributes.AttributeName}}
  • Lookup Asset (Insight) object with ScriptRunner

    • ObjectKey-{{NameYourVariable}}
  • for troubleshooting
    • Comment Issue - {{lookupAsset.attributes.Name}}
    • log info - {{lookupAsset.attributes.Name}}
0 votes
Raphael Lopes
Contributor
April 3, 2025

Hello!!

@Tarik Userli 

 

Try change from ".key" to ".label", maybe this work.

 

Regards.

Tarik Userli
Contributor
April 3, 2025

Hey Raphael,

i allready gave this a chance but did not work :(

0 votes
Marc - Devoteam
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.
April 3, 2025

Hi @Tarik Userli 

Whenever you ask for help with an Automation Rule it will help us to help you if you provide:

1. what type of project is this (e.g., company-managed, team-managed, etc.), 

2. images that show your complete rule.

3. images showing the details of any relevant actions/conditions/branches.

4. images showing the Audit Log details for the rule execution.

5. Explain where the issue is.

These questions are not for not willing to help, but to have community members understand on how automation works.

Marc - Devoteam
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.
April 4, 2025

Hi @Tarik Userli 

Can you provide the details I asked and the details of an object from assets?

Tarik Userli
Contributor
April 4, 2025

Project is Company managed JSM

2025-04-04 10_15_36-[GSA-56885] IT-AM-Medico - Vivaldi.png 2025-04-04 10_14_45-[ITA-80844] CGM Medico - Vivaldi.png 2025-04-04 10_13_49-Automation - Jira and 2 more pages - Work - Microsoft​ Edge.png 2025-04-04 10_12_51-Automation - Jira and 2 more pages - Work - Microsoft​ Edge.png 2025-04-04 10_12_23-Automation - Jira and 2 more pages - Work - Microsoft​ Edge.png

How i already wrote in my main post: issue is that the smar value does not reply the team name just the team key

Marc - Devoteam
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.
April 4, 2025

Hi @Tarik Userli 

So in your lookup object action this value is not found, so yes then it will not be shown in the comment as well.

I see you are on DC and use Scriptrunner ,as the function in the automation is not ootb.

I think this should work: {{lookupAsset.zuständiges Team.Name}}

Best practice is to add a log action, after the lookup. Log the values you would want to use, this will give you insight on what you are missing already before actioning.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
10.3
TAGS
AUG Leaders

Atlassian Community Events