Home General Discussion

[JS help needed] - Hide enum values on Incidents

Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭
edited June 2021 in General Discussion

Hi guys,

we're currently dabbling in ideas for a major incident process and how to set it up. One of the ideas that's floating around right now is that Service Desk (a support group / tier queue in IRs) would be the only business unit who could iniate the Major Incident process by changing an impact / urgency to a value of "1 - Critical".

We would like to have the "Critical" value for impact / urgency hidden for everyone expect when the logged in user is a part of the 'Service Desk' support group / tier queue (doubling down on the whole consistency and socping of the script through the logged in user being part of the service desk support group).

Are there any skillfull coders who could help us out with this? :)

I found this thread for targeting enums lists but I've never really wrote .js so don't know how to script this out .

Thanks in advance!

Best Answers

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    Hey @Gabriel_Lences - I've added some code that can help you filter out enum values if the logged in users is not a member of the specified group. You'll have to configure the group name and the required enums and their values.

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    @Gabriel_Lences - Code is updated. It does what I initially wanted to do now, which is filter the data as it comes back from the api calls. No chance of the picker displaying the value you don't want now.

Answers

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭

    @Gabriel_Lences - You should just be able to define a custom form for the Service Desk AD group with no heavy JS lifting. In Admin Settings -> Group Settings, you can specify what group gets what form. The forms are defined in the Incident.js file (as copied from /CiresonPortal/Scripts/forms/templates into /CiresonPortal/CustomSpace/WorkItem).

    Here's some further reading:

    How To: Create Custom Forms for Cireson Portal

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭
    edited June 2021

    Hey @Justin_Workman! Thanks for that , I know about customizing the forms, however I thought that custom forms only provide the ability to show / hide / differently lay out entire fields and not the values in those fields themselves? Am I missing something?

    How would I go about hiding an enum value in the impact / urgency example in the form for the rest of the people? We only want that one specific enum value to be hidden to the rest, not the entire Impact / Urgency field.

  • James_JohnsonJames_Johnson Customer Advanced IT Monkey ✭✭✭
    edited June 2021

    You can hide enums from the portal by setting a field in the ServiceManagement database. The very bottom of this article talks about how to do it. Creating the Perfect SCSM: Cleaning up Out-of-the-Box Clutter - Cireson

    That would hide it for everyone though. Perhaps you could add a task that is scoped for certain users to change it to the critical value.

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    Hey @Gabriel_Lences - I've added some code that can help you filter out enum values if the logged in users is not a member of the specified group. You'll have to configure the group name and the required enums and their values.

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭
    edited June 2021

    @Justin_Workman thanks Justin this is exactly what we've been looking for! Seems to work like a charm!

    Edit: 1 issue I'm experiencing is whenever I backspace out the enum from the field (as a non-service desk analyst) it shows up the hidden value anyway. Minor issue, but can this be workarounded somehow?

  • Justin_WorkmanJustin_Workman Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    @Gabriel_Lences - Code is updated. It does what I initially wanted to do now, which is filter the data as it comes back from the api calls. No chance of the picker displaying the value you don't want now.

  • Gabriel_LencesGabriel_Lences Customer Advanced IT Monkey ✭✭✭

    Brilliant, this is absolutely awesome, works perfectly, thank you!!

Sign In or Register to comment.