Get the value of a Request Item in a Task UI Policy

Markell
Tera Guru

Hi Guys

So I know this is long winded. But I need to get the value of a field that is set to only be visible in a task (from a Catalog item).
So e.g I create a field called Serial ID.
I need to have it so that in the task if the serial ID has been entered I can get that value and check it or something in a UI Policy on the sc_task table.
Reason for it this way, is I cannot do e.g an onSubmit script on the Cat_Item as technically the request doesn't exist so I cannot check the value from there yet (or so I figure. Happy to be proven wrong)>
So I am thinking a GlideAjax from the Task to get the field but I'm also feeling like I'm thinking myself into a Spaghetti.

Any help welcome 

5 REPLIES 5

Roshnee Dash
Tera Guru

Hi @Markell 
is this your ask

  • A Catalog Item with a field (e.g., Serial ID) that's need to only visible in a sc_task.
  • You want to access the value of that field in a UI Policy on the sc_task table.
  • You can't use an onSubmit client script on the Catalog Item because the request/task doesn't exist yet at that point.
Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

Ankur Bawiskar
Tera Patron
Tera Patron

@Markell 

Sorry but your question is not clear.

It would be nice if you share some screenshots supporting your question

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

AshishKM
Kilo Patron
Kilo Patron

Hi @Markell , 

As per my understanding, you created a catalog item where this 'Serial ID' field is there and its only visible on Catalog Task ( sc_task ) not on the catalog form on portal. You must have added some logic to hide this field on portal like onload 'catalog client script' or Catalog UI Policy.

 

Now when user submitted request and Catalog Task has created , this "Serial ID" is visible there and fulfiller user has to submit the value before closing this task.

 

Is that similar use case you looking for here.

 

-Thanks,

AshishKM

 

 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Markell
Tera Guru

He sorry.
I guess the best way to explain this is I need to have a particular task field  with a script that was in play already, for that task doing validation. I need this script to have validation of if Task Short description is e.g = "Task 1"
then run the script.
I am struggling with this, because on the Cat Item I am not sure I can query that the current task has this short description, because technically the current task does not exist yet. So I think I have to query this on the task table, once the task has been created.
So my thinking is I need to query this via either a UI Policy or Script on the SC TASK table