incident created in self-service portal, state should be New, by default it assigned to Service desk

saikirangd9
Tera Contributor

Hello,

I have been assigned to task which is as follows: Once incident created in self-service portal, incident state should be in New state and by default it should go to Service Desk assignment group. User should be able to find only "In progress" & "Cancelled" state from the state field. Give the best approach to do this in servicenow.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@saikirangd9 

I believe your incident will be created from a record producer since you are talking about portal.

In that record producer script you can set the group and INC will always be in New State

current.assignment_group = 'group sys id';

current.contact_type = 'self-service';

Then you can use onLoad client script on INC and see if the contact type is self-service then remove those options

function onLoad() {
    if (g_form.getValue('contact_type') == 'self-service' && !g_form.isNewRecord()) {
        g_form.removeOption('state', '2');
        g_form.removeOption('state', '8');
    }
}

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

View solution in original post

3 REPLIES 3

glideFather
Tera Patron

Hi @saikirangd9,

 

and where did you get stuck? share some error or explain what you did..

 

For the auto-assignment, check/create Assignment rule. And could you possibly explain what user should find what and where?

PrashantLearnIT
Tera Sage

Hi @saikirangd9 

 

Your requirement is not clear, please let us know the use case for yours.

Ankur Bawiskar
Tera Patron

@saikirangd9 

I believe your incident will be created from a record producer since you are talking about portal.

In that record producer script you can set the group and INC will always be in New State

current.assignment_group = 'group sys id';

current.contact_type = 'self-service';

Then you can use onLoad client script on INC and see if the contact type is self-service then remove those options

function onLoad() {
    if (g_form.getValue('contact_type') == 'self-service' && !g_form.isNewRecord()) {
        g_form.removeOption('state', '2');
        g_form.removeOption('state', '8');
    }
}

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏