Default value for Resolution Category dropdown

Stephane_BouillonStephane_Bouillon Customer IT Monkey ✭
When changing the status of an incident to Resolved, how can I set the default Resolution Category to "By Analist" ?


Answers

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    I am certain this can be done with some JavaScript, but this seems like an excellent feature request--set a default resolution category in the admin settings.
  • Ryan_LaneRyan_Lane Customer Advanced IT Monkey ✭✭✭
    Hello!
    The binding for the Resolution Category enum picker is pageForm.viewModel.ResolutionCategory so we would need to modify the Id and Name values when updating the Status picker to Resolved. From looking at the controller.js for the changeStatus task (CiresonPortal\Scripts\forms\tasks\changeStatus\controller.js) it looks like the appropriate place to do so would be in the enableResolutionSettings function on line 907:

    Inserting the following code into enableResolutionSettings on line 913 should automatically choose 'Fixed by analyst' from the Resolution Category picker:
    vmWindow.set('ResolutionCategory', {	Id: 'c5f6ada9-a0df-01d6-7087-6b8500ca6c2b',	Name: 'Fixed by analyst'});

    One of the problems I could foresee with this approach is using Change Status on an already Resolved Incident would need to be accounted for so that it doesn't attempt to update the Resolution Category when it's already set.  Encapsulating the previous update with a check to see if Resolution Category is not set should do it:
    if(vmWindow.get('ResolutionCategory').Id === null) {	vmWindow.set('ResolutionCategory', {		Id: 'c5f6ada9-a0df-01d6-7087-6b8500ca6c2b',		Name: 'Fixed by analyst'	});}

    Please let me know if this works alright for you!

    NOTE: Please make sure to back up any files you modify from stock just in case.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Not only a great solution, but also great documentation and explanation for it, @Ryan_Lane
  • Adam_DzyackyAdam_Dzyacky Customer Contributor Monkey ✭✭✭✭✭
    At this rate @Ryan_Lane you may be looking at another badge.
  • Stephane_BouillonStephane_Bouillon Customer IT Monkey ✭
    Thanks for your time and effort @Ryan_Lane ;, and I also second @Tom_Hendricks suggestion to make it a feature request ...
Sign In or Register to comment.