I was hoping to be able to trigger either comments or deleting of work items connected using the object id and a custom field that have the object field stored.
As it turns out, you can't use any attributes from the deleted object, so you can't really do anything with this trigger?
This seems to be a silly way to handle object data on delete if we are supposed to be able to automate based on a deleted object, so I must miss something?
How is this trigger meant to actually work if it triggers after the deleting has happened and there is no resistance in the Asset deletion process to ensure its data is available for the automations to use it?
I was expecting a soft delete with a cron to do the hard delete later, but I guess this is not the case?
Or am I missing something obvious here?
First thing, I am not using assets, and thus my suggestions are based on what I know about rules in general. With that out of the way...
My understanding is much of asset object data is looked up just-in-time as the rule proceeds. However, I wonder if there is "some" data still available in {{object}} after the object deleted triggers which can still be referenced.
For work items, the rule engine somehow captures the work item before / during deletion when the issue-deleted event triggers the rule. Thus, even though it is "gone", or soon will be, many of the smart values are still available when the rule is running. Although, one needs to be careful how they are used.
For example, a rule with a Work Item Deleted trigger cannot use a branch on JQL, because that branch automagically adds this to the JQL: AND key != {{triggerIssue.key}} But that will cause the rule to fail because it cannot even test that key with JQL in the rule. Several other branch types can be used, and reference values from the deleted work item.
Perhaps the same happens for the deleted object, and you could experiment to test this by writing to the audit log.
Kind regards,
Bill
@Bill Sheboy is right in his knowledge, the same applies for an Asset object.
If it's deleted, the attributes details are gone, you can reference the attributes used in the Asset you deleted.
The same applies in relation to a work item, as described.
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.
@Bill Sheboy As far as I can tell from my testing there are no ways to actually capture these values from assets using this trigger.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a reminder I am not using assets, and so I was only offering something to test / check, and...
If the {{object}} from the trigger has no attributes you can access with the object deleted trigger, I am also puzzled how it could be used. There is limited Atlassian-provided documentation on any of the asset-related automation features, and I see no examples with that trigger in the example rule library.
You could try posting the question in the developer community or pinging the Atlassian Support team for input on use cases.
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.