Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Problem Tasks redirecting to Parent when clicking on Start Work UI Action

EricG2
Tera Guru

I thought this would  have been an easy task.

Our Problem Manager would like us to modify the OOB UI Action "Start Work".
Currently, when you click this button, the state changes to "Work in Progress", closes, and redirects the user to the Parent Ticket.

EricG2_0-1777378989680.png

EricG2_1-1777379024410.png

I've started by changing line 10 to g_form.update(); and adding 

action.setRedirectURL(current);.
I get error "update" is not a function or if I use g_form.save();, i get "action" is not defined.
 
Comparing other UI actions, this should work.
Any suggestions?
 

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron

@EricG2 

so what should happen when they click?

what was the OOTB UI action config? share screenshot

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

Screenshot of the OOB UI Action is above.

function moveToWorkInProgress () {
	if (!g_form.hasField('state')) {
		getMessage('Cannot Start the Problem task as \'State\' is not visible', function(msg) {
			g_form.addErrorMessage(msg);
		});
		return false;
	}

	//g_form.setValue('state', g_scratchpad.PRBTASK_STATES.WORK_IN_PROGRESS);
	current.setValue('state', g_scratchpad.PRBTASK_STATES.WORK_IN_PROGRESS);
	g_form.save();
		
}

What should happen (desired state) is that the  RCA Task moves to Work in Progress and the system stays on the record.

@EricG2 

that's already happening with that OOTB UI action

The state moves to In Progress and it stays on record

what other customization you want?

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

So, I've double checked my PDI instance.

In here, when I click "Start Work" - It stays on the PTASK.

Which is what I want.

 

In our company instance, the Start Work save the PTASK and redirects you to the Parent Problem.

Not sure what that's happening.