Cireson Portal - Form Customization - Set Field to Required based on Work Item Status

Is there any way to set a field to required based on Work Item Status.

I can set a field as required by adding "required = true," to most fields.  However, I want to set a field to required when the form status changes to Completed, or Failed.

My use case is an Incident or Release record that failed.  While they are suppsoed to enter in a reason why to it failed, there are many that don't.  So i want to force the field to be required when the status (the enumerated value) is in a closing state.



  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    This type of solution would assume that the analyst opens the WI that is completed or failed and tries to save it. Only then would a required field pop up.
    Usually at that point, most analysts (That I've worked with anyhow) would just cancel the save so they don't have to comment.

    A better solution would be a nag that they can't ignore.

    Maybe an e-mail reminder that bugs them every day they do not enter the required detail, or a custom form that pops up on the portal and forces them to make updates before they can do anything else.

    I've done a solution similar to the e-mail one. People quickly learnt to make sure they entered the details in the WI. However, I feel the second option might be a little more polished and professional.
  • AJ_WittenbrinkAJ_Wittenbrink Customer IT Monkey ✭

    I don't think this would be when the analyst open.  This is when the analyst changes the status.  Which would be after the open and change the status.  At that time, client side script to change the required property to true.

    So this would prevent them from saving it with that new status unless something is filled in that field.
  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    You will need to add a custom task that is trigger on a status change:

    I quickly put this together but did not fully test it:

    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {     formObj.boundChange("",function () {         //do whatever you need here         //you have access to the viewModel from here as well         if (viewModel.Status.Id === "2b8830b6-59f0-f574-9c2a-f4b4682f1681") {             $('[name="Title"]').attr( 'required');             $('[for="Title"]').append( '<span>(required)</span');         }     }); });
    In this example, if the IR status is changed to resolved (2b8830b6-59f0-f574-9c2a-f4b4682f1681) I set the Title text field to required and change the label.  

    I hope this helps.

  • AJ_WittenbrinkAJ_Wittenbrink Customer IT Monkey ✭
    James thanks for this.  I recently updated and started to take a look at how Cireson does it with Asset management forms, but this this clean and simple code.  I will test it out and let you know!
Sign In or Register to comment.