Missed Team ’24? Catch up on announcements here.

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

Cascading Custom "Assets" fields - IncomingRelations

Kris Dewachter
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2022

Hi All,

I'm trying to create 2 cascading custom fields, based on Assets information.

My case:

In Assets, I have a simple object scheme with 2 object types: "Machine" and "Part".

"Machine" has a 1-to-many relation with "Part". So "Part" has incoming machine relations. I can see this in the objects.

I have created 2 custom "Assets" fields:

  • "Machine" that allows me to select a machine from the existing objects
  • "Part" which i want the user to be able to select a part, based on the selected machine.

I'm stuggling to get the "Filter issue scope" AQL working in the "Part" custom field.

So far i have tried:

  • object having inR(objectType = "Machine" and Key = ${customfield_10114})
  • object having inR(objectType = "Machine" and Key = ${customfield_10114.Key})
  • object having inR(objectType = "Machine" and Key = ${Machine})
  • object having inR(objectType = "Machine" and Key = ${Machine.Key})

None of them seems to be working. Any idea's on what the correct AQL would look like?

When i create an AQL with a fixed key, it seems to be working correctly. Ex.

  • object having inR(objectType = "Machine" and Key = "MV-123")

 

Thanks,

Kris

 

 

2 answers

1 accepted

2 votes
Answer accepted
Luis Machado
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2022

Hi Kris,

Assuming you have "Part" set up as an attribute of "Machine" try this:

Filter Scope: objectType = "Part"

object having inR(Name = ${customfield_10114.label})

1 vote
Kris Dewachter
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 8, 2022

Hi Luis,

Thanks. Creating a query on 'label' like you suggested works.

I'm still curious to know why searching on "Key" does not seem to work.

Searching on "label" can give too many results when the name of the machine is not unique. You can offcourse prevent this by making "name" unique.

BR,

Kris

Luis Machado
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 8, 2022

This is something I have struggled with as well. My best guess is it's using the API on the backend to call the information and maybe they just haven't created an avenue to pull the key?

By default, ${customfield_####} pulls the objectId from Assets. Using the ".label" returns the label instead which is one of the values you get from running the API call to reference an object, interestingly enough, so is objectKey. However, using something like (Key = ${customfield_####.objectKey}) doesn't seem to work.

Up to this point, I've just chalked it up to Assets still being relatively new in terms of feature development for cloud. But it's no less frustrating for sure.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events