Forums

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

Jira Assets Counting Field

Tim Patrick June 10, 2025

Random requirement from a customer.

Imagine you have a box with a unique ID as an object, and books which all have unique IDs as objects. You then have 3 books in that box which are all linked through the attributes associations.

Can a field on the box object be set up to count how many books have been linked to that box?

Thanks

1 answer

1 vote
Jeroen Poismans
Community Champion
June 10, 2025

Hi Tim,

That is possible. The approach however would be different depending on how the link is made. If the box has an attribute  books, which contains the book objects, you could easily make an automation rule that looks like this:

  • Trigger on object update
  • Condition if objecttype = Box
  • Lookup Objects linked to the box via AQL
    • Use the outboundReferences("") function
    • object having inboundReferences(objecttype = "Box" AND key = {{object.key}})
    • The lookup will return {{lookupObjects}} smartvalue (List)
    • {{lookupObjects.size}} will give you the number of linked books
  • Use this smartvalue to updat the Asset via teh appropriate action to set the count attribute field.

More on smart values:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/

For the correct AQL you might want to use Reference Functions:
https://support.atlassian.com/assets/docs/use-assets-query-language-aql/#Reference-functions

Jeroen

 

Dirk Ronsmans
Community Champion
June 10, 2025

@Tim Patrick ,

Just be aware about your automation rule limits. If you have a lot of updates on these "boxes" you might want to implement this as a Scheduled rule with a "lookupObjects" action rather than have it trigger on each object update.

Other than that, what @Jeroen Poismans  says :)

Tim Patrick June 10, 2025

i really love the answer, but we are on cloud so i dont think automation is an option. is that right?

Jeroen Poismans
Community Champion
June 13, 2025

No, why do you think you would not be able to use automation?

Tim Patrick June 13, 2025

When i go into the schema settings i dont have an automation option.

I didnt think automation was available on the cloud version?

Dirk Ronsmans
Community Champion
June 13, 2025

On Cloud there is no longer a separate automation for Assets and Jira they are rolled in to one automation engine.

If you go to "Global Automation" you can use the actions/triggers/... for Objects (which is Assets)

Tim Patrick June 13, 2025

OK, so i would need to go into admin on JSM instead?

Dirk Ronsmans
Community Champion
June 13, 2025

Depends a bit on what you call "admin".

The quickest would be to go to:

https://[yoursitename].atlassian.net/jira/settings/automation

or to open the command pallet (Ctrl+K) and type "global automation"

Tim Patrick June 13, 2025

OK, so i don't have access to that.

That's fine, i will get that arranged.

Really appreciate your support.

Suggest an answer

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

Atlassian Community Events