Redirect to problem record

Southsayer
Tera Expert

Hello Guys,

 

I have a requirement i.e. to open a problem form whenever in the Change form we change state from schedule to implement. Remember we don't need to create a problem record but just open a problem record. (also how can we populate a few fields on the problem record like description or short description)

 

I can achieve this with UI actions but I wanna do it using business rules, is it achievable? 

this is the script I wrote but it is not working

 

(function executeRule(current, previous /*null when async*/) {
if (current.state == 'Implement' && previous.state == 'Scheduled') {
var redirectURL = 'incident.do?sys_id=-1';
action.setRedirectURL(redirectURL);
}
})(current, previous);
 
 
thanks in advance
2 REPLIES 2

_Gaurav
Kilo Sage

HI @Southsayer 
Seems like the question is not clear, could you please explain more on this?

Shivpoojan
Tera Contributor

HI @Southsayer

Confirm if my understanding is correct for your question above.

You want to create a business rule on run condition (when state of the change changes from scheduled to implement). This business rule should then redirect the user to a new problem form. 

 

My questions for clarification are:

Q1. What fields do you want to populate when you open a new problem record.

Q2. Where do you intend to open the new problem record in same window or in new window.

 

Suggestions:

I would suggest to go with the UI action for your scenario since it might cause a bad user experience where users are prompted directly to a problem record whenever state changes or have a confirmation message to open a new record. It would be great if you can explain feasibility of you use case.