Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

task.sys_id is returning null value in catalog task workflow

peshwen
Giga Contributor

Hi All,

I am trying to get sys_id of catalog task in workflow. So i tried to get it by assigning it to some variable it was not returning nothing..i am trying this code in advanced script in catalog task.

Please help me on this

Thanks,

Nikhil

11 REPLIES 11

anurag92
Kilo Sage

Catalog Task activity will create and set fields of Catalog Task, but in the activity itself you won't be able to retrieve it's field values. I suggest adding another Run script activity after Catalog Task activity and then glide task table to get the sys id.


I don't believe this is a solution, as this breaks the functionality of completing tasks within the workflow.   This "run script" will not run until the task is 'complete'.   The SN documentation clearly states that the advance scripts run AFTER the insert, meaning that task.sys_id is broken.   Previously one could use task.sys_id judging by the other people's past community posts, however SN seems to have broken this basic functionality in later releases!



Re: get child task



How is one mean't to add a checklist to a task item, to ensure all things have been completed in the task before continuing on?   SN not only broke the insert sys id for task workflow activity with the advance script, they nerfed their own "checklist" functionality. /shakeshead.



If someone could suggest a solution, it would be great.


I do agree with you. How can it be possible to suppress this functionality without justifying this choice?



For the moment, I guess I have to do the Glide Record query workaround in a parallel Run Script Activity with a timer to wait for the insert of the SCTask to complete... (Or a Insert BR on the sc_task table (with a tricky condition)).



Come on, give us the task.sys_id back !


Does anyone know when this stopped working? If we can pinpoint it, we might be able to get it fixed as a regression.