Unable to update the Assignee value on incident table and task table

pavam
Tera Contributor
 From the schedule Job i was trying to update the Assignee value and state Field values in the Incident and Task table 
with the below code.
I can successfully update assignee field with the below script , but state value is not getting update.
 
var t1= new GlideRecord('incident');
  t1.addQuery('assigned_to', username1);
  t1.addEncodedQuery(inctkts);
  t1.query();
 
  while(t1.next()){
 
if (t1.getRowCount() > 0) {
    
t1.setWorkflow(false);
t1.assigned_to=' ';
t1.state='1';
t1.update(); 
 
}
       } 
 
Can any one help on this to me.
 
Highly appreciated in advance for the help.
1 ACCEPTED SOLUTION

Hi @pavam,

 

I'm not sure you're quite understanding me. Can you test the script as a Scheduled Job against 1 specific ticket to ensure the script is working.

I've tested it and it works as expected which is pointing to the encoded query that is not shared.

You can test against a single record by adjusting the script similar to mine.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.



Thanks, Robbie

View solution in original post

10 REPLIES 10

Hi @pavam,

 

I'm not sure you're quite understanding me. Can you test the script as a Scheduled Job against 1 specific ticket to ensure the script is working.

I've tested it and it works as expected which is pointing to the encoded query that is not shared.

You can test against a single record by adjusting the script similar to mine.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.



Thanks, Robbie