how to modify "Create Emergency Change" UI action to only be visible on P1/P2 incidents

davematz
Giga Expert

I am working on the ITSM simulator for Madrid version in the Now Learning portal and am having a problem solving this.

I have gone to the "Create Emergency Change" UI action for the Incident (incident) table, but cannot figure out how to get the correct solution.  I have tried a number of different things, but none have been validated in my simulator.

I would appreciate the exact answer that I should have with steps explaining your solution so I can learn from this instead of getting frustrated because I don't understand.  Thank you.

1 ACCEPTED SOLUTION

It should be: && (current.priority == 1 || current.priority == 2)

add that to the original statement. If priority is 1 or 2 this will evaluate to true.

View solution in original post

14 REPLIES 14

Thank you Michael.

Why did I not have to use "incident_priority" like the "incident_state" argument?

I looked at configure dictionary on the State field on the incident form and saw the field name = state.  Therefore, I just did the same for the priority field name.  Why did I not need to do this format?

incident_state is actually a field whereas incident_priority is not. The field is called priority.

BTW - there is also a State field on incident too but best practices is to use incident_state. The 2 fields should sync with each other.

I also tried the solution you provided, but I had used priority incorrectly (current.incident_priority == 1 ||current.incident_priority == 2)

yes Michael, in the condition guys, not in the body script. Thank you for the help !

Pilar1
Tera Contributor

Hi,

I tried this and run perfect.

 

current.priority == 1 || current.priority == 2 &&current.incident_state != IncidentState.CLOSED && gs.hasRole("itil,sn_change_write") && gs.fieldExists('incident', 'rfc') && current.rfc.nil()