I am creating a recurring check for company devices.
Work items are created in the protect, based on time since last check date that is stored as an attribute on each device object in assets.
I have this part working - tickets are created, and the correct object is inserted to a custom field on the work item as reference.
The part i can not figure out how to do is as follows:
I want a rule that is triggered when the work item moves from in progress to done. - creating the trigger is easy part...
Then i want to lookup the object that is referenced in the custom field on the work item, and edit the custom attribute I added "last check date" replacing the existing value with current date.
I am struggling to understand how to find the specific object listed in the work item.
You will need to use the lookupobject action
example clause: objecttype = <name of the object type> and key IN {{issue.customfield_xxxxx}}
Where xxxxx is the id number of the field
Then add a branch, select the asset schema and add the smart value key = {{lookupObjects.key}}
And add an edit object action in the branch.
example clause: select the attribute and use smart value {{now}}
Hi Marc,
Thanks for your help - I am making progress. However i must be missing something, as the above does not find any objects
Here is what i have:
and this is the log from the rule run:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the lookup, use objectType = <name of the object type>, don't use objecttypeid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok - thanks - changed that back, and still no objects found.
Appreciate your help on this. Its been driving me mad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you add a log action
Use smart value {{issue.customfield_10720.key}}
Does that give any result?
Is customfield_10720 an assets custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Marc -Devoteam-
Tried the alternative, still no objects found
The custom field is an assets object field yes
Added a log action (gamechanger - did not know about this!) and the value is returned correctly from the field, using both methods you mentioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the lookup, can you change the smart value from:
objecttype = "Employee Laptops" and Key in {{issue.customfield_10720}}
to:
{{#debug}}objecttype = "Employee Laptops" and Key in {{issue.customfield_10720}}{{/}}
This will also do a log action on the AQL.
What is the result?
The resuls should be like this; objecttype = Employee Laptops and key IN <asset key>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marc,
Changed as istructed, and this is the log :
This is the assets :
I have no idea why it is not finding them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In order to edit an object you need to create a global automation, then you can use the AQL branch to lookup the object and then use the edit object to set the attribute you want to update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.