how to write buisness rule for incident creation from inbound action caller_id is user table should

AJAYKUMAR G
Tera Contributor

how to write buisness rule for active users to incident creation from inbound actions.

2 REPLIES 2

Samaksh Wani
Giga Sage
Giga Sage

Hello @AJAYKUMAR G 

 

find_real_file.png

 

find_real_file (1).png

 

 

 

current.caller_id = gs.getUserID();


current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;


current.short_description = email.subject;


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.importance != undefined) {


    if (email.importance.toLowerCase() == "high")


          current.priority = 1;
}


if (email.body.priority != undefined)


    current.priority = email.body.priority;


current.insert();

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

Neha Patil
Tera Contributor

Hello @AJAYKUMAR G ,

Go through inbound email actions and create new one give table name "incident".

Then give condition state is new

then go to event and create one event -

In Business Rule write down that script -

if (current.state == 3) {
//Your inbound code here
}

if (current.active == false) {
// Activate a ticket is closed event if active is false (closed)
gs.eventQueue("ticket.open", current, current.state, previous.state);
}