Redirect to survey once the incident is closed by user in service portal

Vishnu V Reddy
Tera Contributor

Hello everyone,

We have a widget on the incident form in Service portal in which we have a close incident button accessible by the customer. Once he clicks on the close incident button, right now it simply closes the incident and stays on the form.

We want to direct the user to the survey of this incident once the user clicks on close incident. How do we achieve this? What changes should I be making in the widget? I tried hardcoding the url using document.location = "?id=take_survey&instance_id=here comes the instance_id which is the sys_id of the survey".  But I am having hard time retrieving the "instance id/sys_id" of the survey in the widget controller that was created.

 

Looking to resolve this as soon as possible. Thank you.

6 REPLIES 6

Allen Andreas
Administrator
Administrator

Curious what other people will say, but do you at least have your surveys trigger the creation upon Incident being closed? If so, you have a BR for that that is made automatically, I'd recommend perhaps finding that BR, then maybe gliding over to Incident and dropping the link to it on a field that's hidden there? Then in your UI action to close the incident, have a small delay, then drop an infomessage with the link that's provided by the BR dropping it. That's just my guess on how I would start to work this.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

 

So I was able to get the instance id of the survey onto a hidden field on the incident table. But, I am not able to retrieve that value from the field in the incident table. As soon as I click on the close incident button in portal. It takes me to the survey form but shows the invalid url error and this is the url "?id=take_survey&instance_id=undefined". 'undefined' is where the instance_id should be.

Yes, hence why I said to have a small delay so that it could populate. See my other post for possible assistance. Please also mark my other reply as Helpful if that's the direction you're deciding to go.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Could you help me in adding a delay in the redirection? Maybe that will give the time to retrieve the instance id from assessment table.