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

JSM - Updating Asset Object Field Attribute

Reece Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 9, 2024

Background:

I'm trying to do a very simple POC whereby a user goes to the service desk, requests access to the GitLab SaaS application, the ticket has some automation behind it that first checks if we have licenses and then if it does, does license count = license count -1. So in theory that license is then allocated to that user.

My setup

I've created a new Asset object Schema called 'SaaS'

Inside the Schema Tree I've created 'SaaS Application'

I've then created a new Asset Object called 'GitLab'

I've added a new attribute to this Schema called 'License Count' (integer)

I've set the GitLab object to have 100 under License Count.

Automation so far:

  • When: Issue Created
  • If: Request Type equals SaaS Gitlab Access
  • Then: Lookup Objects (Schema: SaaS) (Query: key = SAAS-4)
  • IF: Matches 
    • {{lookupObjects.License Count}} greater than 0
  • Then: Add comment to issue
    • Comment: 'Licenses Available, allocating'
  • And Then: Edit Object
    • Choose attributes to set: License Count
    • License Count: {{lookupObjects.License Count.minus(1)}}

It all works until the edit object part, for the life of me I cannot get the asset object to change value.

I see this error on the edit object:

'One of the following needs to be produced earlier in the rule by the trigger or with a 'for each' branch for this component to work: CMDB object'

Anyone tried this? Or have any suggestions, I was hoping this would be simple! 

1 answer

1 accepted

2 votes
Answer accepted
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2024

Hi and welcome to the Community!

Is something I came across also several time. The key here is to go in a branch (AQL), fetch the object, then in the branch do the edit:

Screenshot 2024-07-09 at 18.09.55.png

In your case i think it could be:

key = SAAS-4

This would only return 1 object which in the Then you will be able to edit.

Jeroen

Reece Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2024

Amazing thank you! One thing to note for other people reading this, is that to use AQL Branch you need to have the automation under Global Automation

Like Laurie Sciutti likes this

Suggest an answer

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

Atlassian Community Events