4/17 UPDATE: I changed the question and will post solutions I found in comments to avoid making this longer.
Original Post:
I am creating a project that when the issue is updated I need to update the Asset object which was created via a post-function. Using a party planning theme for my example.
Issue Created = OR-44
Issue Fields & Attributes in Object Type:
Summary (text field) = Anna Beth Collins 6th Birthday Party
Description (text field) = Mrs. Collins requested Holmes Party Planning services for her daughter's birthday. Initial meeting will be held 2/14/24 with finalization meeting will be held 4/4/24.
Supplies Required (text field) = Party Hats, Candy, various little toys
Event Support = (currently empty)
Initial Ticket Key (text field) = OR-44
Contract # (text field) (generated during 'Contract Signing' status) = FAVOR-44
Schema Unique Identifier (Asset object) = (currently empty, but configured to show list of the Initial Ticket Key attribute)
Object is created on Object Type 'Parties' through Post-Function of 'Contract Signed' Transition Object Key = DAO-234432
Wish to Edit/Update the issue with the following:
Supplies Required = Party Hats, Candy, various little toys, plates, napkins, forks, cake, poppers, 5 tables, 30 chairs, 5 table cloths, balloons, balloon arch, purple sparkly birthday cake candles
Few things about the Object schema created:
1. Created attributes to match each field on issue.
2. Contract # is not a unique attribute.
3. Initial Ticket # is a unique attribute.
I've tried to copy the Initial Ticket Key to the Schema Unique Identifier field in an automation rule triggered when the fields are edited. Re-fetched the data, then use the Lookup Asset (Insight) objects from AQL (IQL) with ScriptRunner to pull the object info and then use Update Asset with ScriptRunner to update the attribute(s).
AQL/IQL query for the Lookup Asset (Insight) objects from AQL (IQL) with ScriptRunner currently using is:
objectType = "Parties" and "Initial Ticket Key" = {{issue.Initial Ticket Key}}
Update Asset with ScriptRunner for is:
{
"objectTypeId": 217,
"Summary": {{#if(not(equals(issue.customfield_12002,null)))}} "{{issue.customfield_12002}}" {{/}} {{#if(equals(issue.customfield_12002,null))}}null{{/}}
"Description": {{#if(not(equals(issue.customfield_12107,null)))}} "{{issue.customfield_12107}}" {{/}} {{#if(equals(issue.customfield_12107,null))}}null{{/}}
"Supplies Required": {{#if(not(equals(issue.customfield_12005,null)))}} "{{issue.customfield_12005}}" {{/}} {{#if(equals(issue.customfield_12005,null))}}null{{/}}
"Event Support": {{#if(not(equals(issue.customfield_12012,null)))}} "{{issue.customfield_12012}}" {{/}} {{#if(equals(issue.customfield_12012,null))}}null{{/}}
"Initial Ticket Key": {{#if(not(equals(issue.customfield_12013,null)))}} "{{issue.customfield_12013}}" {{/}} {{#if(equals(issue.customfield_12013,null))}}null{{/}}
"Contract #": {{#if(not(equals(issue.customfield_12014,null)))}} "{{issue.customfield_12014}}" {{/}} {{#if(equals(issue.customfield_12014,null))}}null{{/}}
}
If there is another way to accomplish this, I am most certainly open to it.