priority lookup issue

tGhadage
Tera Contributor

hi guys, 

 

have another condition when if the mail is mine and subject line is (testing please ignore) then create an incident to p2 but In the priority lookup table as shown below the when the urgency is 3 and impact is 1 priority is set to 2.

 

Screenshot (286).png

but when the in the script i have set the same values but still its showing the priority is as 4. ( its not commented ignore it )

script is shown below: 

Screenshot (287).png

and incident record that got created is also shown below:

Screenshot (288).png

can someone please help!! 

 

Thanks!

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Seeing your last image, impact and urgency are empty. Therefor the default value will be shown for priority, which is most likely 4? So nothing wrong with the priority lookup.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

is there something wrong in the script because earlier it was working fine for the same script.

Screenshot (289).png

Can't tell since you are only showing a tiny piece of the script.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

here is the code
 
 
//  Note: current.opened_by is already set to the first UserID that matches the From: email address
if (email.to.indexOf("test@test.com") > -1 ||
    email.to.indexOf("test@test.com") > -1 ||
    email.to.indexOf("test@test..com") > -1 ||
    email.to.indexOf("test@test.") > -1 ||
    email.origemail.indexOf("test@test.") > -1 ||
    email.origemail.indexOf("test@test.") > -1 ||
    email.origemail.indexOf("test@test") > -1 ||
    email.origemail.indexOf("test@test") > -1 ||
    email.origemail.indexOf("test@test") > -1 ||
    email.origemail.indexOf("test@test") > -1 ||
    email.origemail.indexOf("test@test") > -1
) {
    current.caller_id = gs.getUserID();
    current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
    current.short_description = email.subject;
    var sender_email = email.from;
    current.location = getLoc(sender_email);

    //current.category = "request";
    current.incident_state = IncidentState.NEW;
    current.notify = 2;
    current.contact_type = "email";

    if (email.body.assign != undefined)
        current.assigned_to = email.body.assign;

    if (email.body.priority != undefined)
        current.priority = email.body.priority;

    if (email.to.indexOf("test@test) > -1 ||
        email.to.indexOf("test@test") > -1)
    //          if (email.to == "test@test")
    {
        current.category = "Spark CRM";
        current.assignment_group = '0116534913cd220031d0bb176144b0c2'; //App_Spark_CRM_Monitor          
    } else if (email.from.indexOf("test@test") > -1) {
        current.category = "Infrastructure";
        current.u_lattice_type = "Arctic Wolf";
        current.assignment_group = '676b5ac32c3910408c7038b77dce0581';
    } else if (email.origemail.indexOf("Tushar.Ghadage@latticesemi.com") > -1 && email.subject.indexOf("Fw: GL   Workbench New Extract Refresh Failed") > -1) {
        current.impact = 1;
        current.urgency = 3;
        current.priority = 2;
        current.short_description= email.subject;
    } else {
        current.assignment_group = '676b5ac32c3910408c7038b77dce0581'; //Helpdesk Group
        current.category = "ServiceDesk";
    }
}

//Fetch user location
function getLoc(user_email) {
    var gr = new GlideRecord('sys_user');
    gr.addQuery('email', user_email);
    gr.query();
    if (gr.next()) {
        return gr.location; //returns user's location sys_id
    }
}

// Rafael Merces - 19/04/2018 - INC0317661 - Add description to forwarded incidents
current.description = "From : " + email.from + "\n Origemail :" + email.origemail + "\n" + email.body_text;
current.u_source = "email";
current.insert();
 
 
these is the code for privacy purposes have changed it to test@test.com.
 
thanks!!!!