current.incident_state = 1 and current.notify=2 for new and forward type HR case inbound actions

Arka Banerjee
Kilo Guru

Hi Team,

 

In all of our new and forward type inbound actions for ur HRSD HR case creations, we have the below 2 lines of script as first 2 lines. However I am not able to understand their usage. Can you please help.

 

current.incident_state = 1

current.notify=2

 

@Ankur Bawiskar 

4 REPLIES 4

Bhuvan
Kilo Patron

@Arka Banerjee 

 

Notify is a choice field. As part of inbound email action, when you are creating a record in target table, you set notify=2 which means send email notifications

Bhuvan_5-1757321032047.png

Bhuvan_2-1757320731075.png

Bhuvan_3-1757320768907.png

Similarly incident state is a choice field and you are setting state is Open when creating the incident record

Bhuvan_4-1757320856415.png

I hope you appreciate the efforts to provide you with detailed information. If my response helped to guide you or answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

Ankur Bawiskar
Tera Patron
Tera Patron

@Arka Banerjee 

I am not sure why incident_state field is set in your HR Inbound action as it's field specifically for INC and nothing to do with HR Case.

Things to check

1) Is that an OOTB Inbound action or custom one?

2) If custom then you will have to check with the developer who wrote that.

3) Also check if incident_state & notify fields are there on HR Case table or not?

4) If not then somebody copied the code from some other inbound action and wrote it for HR Case table

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

They are custom inbound actions. Also I found that the notify and incident_state fields are not part of the Hr workforce administration table, which is the target table of these inbound actions. 

 

But at the same time, I didnt find any Incident based Inbound actions which is having these 2 lines of code. So I am a bit confused..

kaushal_snow
Mega Sage

Hi @Arka Banerjee ,

 

current.incident_state = 1

 

In typical incident inbound actions (like Create Incident), setting current.incident_state = IncidentState.NEW assigns the incident state to New, which corresponds to the numeric value 1. Even if your inbound action targets a non incident table (e.g HR case), this line remains likely copied from the same.....Practically, if incident_state isn't a valid field on your target table, this line doesn’t do anything but keeps consistency with oob scripts drawn from incident mgt...

 

current.notify = 2

This line sets the notify field on an Incident to a specific notification behavior...According to the default Notify choice list, a value of 1 corresponds to Do Not Notify. Value 2 typically enables notifying often a Notify or default style. Although exact label varies, it's placeholding the notification behavior....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community..

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/