Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Unable to retrieve objects through lookupObjects when referencing reporter of issue

Hi all,

 

I am trying to retrieve a list of all objects associated with an employee through AQL.

 

Employee is an object in my object schema which has multiple properties such as Name and User (object).

Statement below works and retrieves all the objects

object HAVING outboundReferences(objectType = "Employees" and Name = "John Doe")


I have tried several options to make this generic but none of them seem to work

object HAVING outboundReferences(objectType = "Employees" and Name =  ${reporter.displayName})

object HAVING outboundReferences(objectType = "Employees" and User =  currentReporter())

 

What am I doing wrong? Any suggestions?

 

Thank you!

 

 

1 answer

1 accepted

0 votes
Answer accepted
Marc Koppelaar
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.
Oct 25, 2023

Hi @Hielko Manders 

Welcome to the community.

With AQL you are referencing Assets in a scheme, this relates to the information in the scheme.

Within in AQL you can't use JQL (If I remember correct).

There are options to use user references in JQL, but the object used in AQL needs to have a attribute in the object of the type user.

See also AQL documentation

Employee asset.JPG

Hi Marc,

 

As you can see I have an attribute of type user in my schema but when I use currentReporter(), which can be used in AQL the query still doesn't return any objects.

 

Regards,

Hielko

Marc Koppelaar
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.
Oct 25, 2023 • edited

Hi @Hielko Manders 

What is the value set to the attribute in the object?

To use current user, you have to specified in the object as the user.

Hi @Marc Koppelaar 

It is a Jira account.

Marc Koppelaar
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.
Oct 25, 2023

Hi @Hielko Manders 

I get this, but is there one account mentioned, is this yours or another account.

This function will only work when an issue is selected, and refers to the reporter that appears in the current issue.

@Marc Koppelaar 

 

The use case is "Offboarding employee". When an issue is created where request type is "Offboard employee" I want to create tickets for HR, IT etc in order to revoke access to IT systems, return assets such as laptops. 

I am trying to get it working by referencing the Reporter of the issue but that somehow doesn't work.

I also tried to ad a custom field Employee and tried to reference that field through $object HAVING outboundReferences(objectType = "Employees" and Name = ${customField_10211.name})

 

Does this make sense? 

Marc Koppelaar
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.
Oct 25, 2023

Hi @Hielko Manders 

I think you need to get Automation in the loop.

Where you need to probably create a variable that stores the name of the reporter or use the custom field you created

Then see if you can make a lookup action to find the right employee based on the variable created or the custom field that you have created

Would that be something to investigate

Like Marc Koppelaar likes this

@Marc Koppelaar issue solved! In the end it was extremely simple.

Not working

object HAVING outboundReferences(objectType = "Employees" and Name = {{Employee.Name}})

Working

object HAVING outboundReferences(objectType = "Employees" and Name = "{{Employee.Name}}")

The property should be surrounded by double quotes. The thing that throws you off is that if you use this syntax the Validate syntax button isn't enabled so you think the syntax is not correct.

 

Thanks for the help,

 

Hielko

Like Marc Koppelaar likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events