I want to hide the create story option when incident state is resolved, closed, canceled

Ashwini Sawant2
Tera Contributor

Hello Team,

For UI Action - Create Story 

I have this existing query -  

(current.incident_state != IncidentState.CLOSED || current.incident_state != IncidentState.CANCELED || current.incident_state != IncidentState.RESOLVED) && (current.u_story.nil()

 

By this condition, the option of 'create story' is still populating , kindly suggest on this. How we can restrict this ? 

 

Thanks,

Ashwini

 

 

1 ACCEPTED SOLUTION

Ethan Davies
Mega Sage
Mega Sage

Change your ORs to ANDs. Also from the condition you posted, you are missing a ')' at the end of your condition. This may cause an error / always evaluating your condition to TRUE.

 

(current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.CANCELED && current.incident_state != IncidentState.RESOLVED) && (gs.nil(current.u_story)

 

View solution in original post

4 REPLIES 4

Ethan Davies
Mega Sage
Mega Sage

Change your ORs to ANDs. Also from the condition you posted, you are missing a ')' at the end of your condition. This may cause an error / always evaluating your condition to TRUE.

 

(current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.CANCELED && current.incident_state != IncidentState.RESOLVED) && (gs.nil(current.u_story)

 

Thank you for your response.

 

I found the working code - 

(current.incident_state != IncidentState.CLOSED && current.incident_state != IncidentState.CANCELED && current.incident_state != IncidentState.RESOLVED && current.u_story.nil())

good to know, so this missing ")" was main reason. 

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

AshishKM
Kilo Patron
Kilo Patron

Hi @Ashwini Sawant2 , 

 

Check if the last ")" missing or its just a typo in question. 

Also, the given query is condition in UI Action, share the UI Action screen shot.

 

-Thanks,
AshishKMishra


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution