ATF: Update Item Variables from Task Record

jmiskey
Kilo Sage

I am creating an ATF to work a RITM that was submitted via the Service Portal.  I am at the step in  my workflow where a Task needs to be opened, certain fields populated, and then closed.  I have done these before in the past without issue, but this one has a "twist" to it.  Two of the fields that need to updated on the Task are actually Variables from the Catalog Item (specifically, they are in a Variable Set that the Catalog Item uses).

So, in my "Set Field Values" step on the Task, I am looking for these two fields to update.  I expanded "Show Related Fields", but I could not locate these two fields.  How can I update these two fields from the Task record in ATF?

Thanks

1 ACCEPTED SOLUTION

Gerald Onyia
Kilo Guru

Hello!

So after you Record Query the Task, and Open the existing record (Task), you can set variable values by using the 'Set Variable Values' under 'Service Catalog' Step, NOT 'Service Catalog in Service Portal'. It will prompt you to select your catalog item, but might not display any variables initially. That's fine. Once you've selected your catalog item, save it, and then re-open the step. Once re-opened, you can then select the variable values.

- Gerald

View solution in original post

4 REPLIES 4

Gerald Onyia
Kilo Guru

Hello!

So after you Record Query the Task, and Open the existing record (Task), you can set variable values by using the 'Set Variable Values' under 'Service Catalog' Step, NOT 'Service Catalog in Service Portal'. It will prompt you to select your catalog item, but might not display any variables initially. That's fine. Once you've selected your catalog item, save it, and then re-open the step. Once re-opened, you can then select the variable values.

- Gerald

Thanks Gerald.  That did the trick!

If you have some time, I was wondering if you might know how to apply the method that Trena proposed for dealing with Timers that run a long time in ATF testing (see: https://community.servicenow.com/community?id=community_question&sys_id=99eec835dbc89c5c6064eeb5ca96...). 

Her idea sounds like it should work in theory, but I have not been able to figure out what that code looks like, mostly because I am not sure how to find the correct trigger record for a particular RITM.

No problem man!

I responded to Trena through the other discussion. I'm curious as to what she is referring to. I am a visual guy, so I would like to see her code.

Thanks.  It seems like a pretty cool, clever workaround, and I really want to see how it is done!  I have been trying to figure out the connection on my own, and have hit a dead end.