locked
New HTML5 portal and custom incident statuses RRS feed

  • Question

  • Hello, everyone!

    I am currently implementing SCSM to one of customers and we made decision to go with the new HTML5 portal. However, I found a problem that I haven't seen mentioned elsewere - MyRequests section of the portal only correctly works with default ticket statuses.

    For example, we have 1 more non default incident status in use - "Assigned" (with custom workflow in place). This status is a subitem of "Active" in the incident status list. However, it seems like portal parses only the default statuses, and anything else is treated like "Closed". When console shows the incident is "Assigned" state, portal shows this incident under "Closed" section.

    I did dig through the cshtml to find that "Status" value comes from ViewBag object, but it seems like this ViewBag is populated and parsed within some dll. With my weak programming skills I could imagine this to be if, then, else, which uses default enum values, and the code ends with else status=closed.

    Could someone else try this out and confirm this issue, or maybe even have a solution already?

    Thanks in advance.



    Janis Berzins / Senior Infrastructure Solutions Consultant

    Friday, January 22, 2016 11:29 AM

Answers

  • Thank you, Abihshek!

    I did come up with very similar code myself yesterday and can confirm that this works.

    In the process of trying to discover this myself, I came to conclusion that everyone will have this problem also with default incident status "In progress" (Enum.StatusInProgress), it will show up as Closed without this code.

    This, however, is workaround, and correct status should come already from ViewBag.RequestStatus and requestDetails["RequestStatus"].

    I hope this issue will addressed in the next hotfix for the portal.


    Janis Berzins / Senior Infrastructure Solutions Consultant

    • Marked as answer by Janis Berzins Thursday, January 28, 2016 2:08 PM
    Thursday, January 28, 2016 2:08 PM
    • Here is what you have to do IR in xxx state to map to Active State–

      • Following addition needs to be done in Views\MyRequests\Index.cshtml –

    @{

        List<Dictionary<string, object>> sortList = ViewBag.RequestsList;

     

        string idClicked = ViewBag.ClickeID;

        var reqType = ViewBag.ReqType;

        var criteria = ViewBag.Criteria;

        string clicked_filter = ViewBag.ClickedFilter;

     

        foreach (Dictionary<string, object> listitem in sortList)

        {

            if (listitem["Status"].ToString().Equals("xxx"))

            {

                listitem["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            }

        }

    }

     

      • Following addition needs to be done in Views\MyRequests\RequestDetails.cshtml –

    @{

    …………

       

        if (changeStatusButtonText != null)

        {

            if (changeStatusButtonText.Equals("ActivateRequest"))

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.ActivateRequest;

                changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToActivate;

            }

            else if (changeStatusButtonText.Equals("CancelRequest")) //Active

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

                 changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;

            }

        }

     

        if (requestEntry["Status"].ToString().Equals("xxx"))

        {

            requestEntry["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

            changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;       

        }

     

    }

     

    Thursday, January 28, 2016 2:00 PM

All replies

  • Hello,

    I would like to suggest you try to apply the hotfix below to check whether it can helpful:

    https://www.microsoft.com/en-us/download/details.aspx?id=50362

    In addition, it seems next update will be coming soon.

    Regards,

    Yan Li


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Saturday, January 23, 2016 4:26 AM
  • Thank you for your reply.

    However, hotfix you mentioned is already applied and problem still remains.

    I would like to someone to confirm that this problem exists in other SCSM implementations as well, therefore I would wait for a fix, and not try to solve it in other ways.

    Thanks!


    Janis Berzins / Senior Infrastructure Solutions Consultant

    Monday, January 25, 2016 7:47 AM
    • Here is what you have to do IR in xxx state to map to Active State–

      • Following addition needs to be done in Views\MyRequests\Index.cshtml –

    @{

        List<Dictionary<string, object>> sortList = ViewBag.RequestsList;

     

        string idClicked = ViewBag.ClickeID;

        var reqType = ViewBag.ReqType;

        var criteria = ViewBag.Criteria;

        string clicked_filter = ViewBag.ClickedFilter;

     

        foreach (Dictionary<string, object> listitem in sortList)

        {

            if (listitem["Status"].ToString().Equals("xxx"))

            {

                listitem["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            }

        }

    }

     

      • Following addition needs to be done in Views\MyRequests\RequestDetails.cshtml –

    @{

    …………

       

        if (changeStatusButtonText != null)

        {

            if (changeStatusButtonText.Equals("ActivateRequest"))

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.ActivateRequest;

                changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToActivate;

            }

            else if (changeStatusButtonText.Equals("CancelRequest")) //Active

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

                 changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;

            }

        }

     

        if (requestEntry["Status"].ToString().Equals("xxx"))

        {

            requestEntry["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

            changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;       

        }

     

    }

     

    Thursday, January 28, 2016 2:00 PM
  • Thank you, Abihshek!

    I did come up with very similar code myself yesterday and can confirm that this works.

    In the process of trying to discover this myself, I came to conclusion that everyone will have this problem also with default incident status "In progress" (Enum.StatusInProgress), it will show up as Closed without this code.

    This, however, is workaround, and correct status should come already from ViewBag.RequestStatus and requestDetails["RequestStatus"].

    I hope this issue will addressed in the next hotfix for the portal.


    Janis Berzins / Senior Infrastructure Solutions Consultant

    • Marked as answer by Janis Berzins Thursday, January 28, 2016 2:08 PM
    Thursday, January 28, 2016 2:08 PM
    • Here is what you have to do IR in xxx state to map to Active State–

      • Following addition needs to be done in Views\MyRequests\Index.cshtml –

    @{

        List<Dictionary<string, object>> sortList = ViewBag.RequestsList;

     

        string idClicked = ViewBag.ClickeID;

        var reqType = ViewBag.ReqType;

        var criteria = ViewBag.Criteria;

        string clicked_filter = ViewBag.ClickedFilter;

     

        foreach (Dictionary<string, object> listitem in sortList)

        {

            if (listitem["Status"].ToString().Equals("xxx"))

            {

                listitem["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            }

        }

    }

     

      • Following addition needs to be done in Views\MyRequests\RequestDetails.cshtml –

    @{

    …………

       

        if (changeStatusButtonText != null)

        {

            if (changeStatusButtonText.Equals("ActivateRequest"))

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.ActivateRequest;

                changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToActivate;

            }

            else if (changeStatusButtonText.Equals("CancelRequest")) //Active

            {

                changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

                 changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;

            }

        }

     

        if (requestEntry["Status"].ToString().Equals("xxx"))

        {

            requestEntry["RequestStatus"] = Resources.SelfServicePortalResources.Active;

            changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;

            changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;       

        }

     

    }

     


    If you request input from user on a incident, it`ll get pending and also shows as closed. We`ve added the additional lines to our config, but are having trouble getting it to work.   I guess we`re usnig it wrong, but we`ve tried adding "Pending" and "Active.Pending" to the additional config where = "xxx"
    Friday, February 5, 2016 7:52 AM
  • Try output @requestEntry["Status"].ToString() value somewhere in the form to see correct enum value, which you will afterwards use in "xxx" place. This applies both to built-in enum values, as well as any other custom incident status values.

    Janis Berzins / Senior Infrastructure Solutions Consultant

    Friday, February 5, 2016 8:15 AM
  • For me, the solution was to use the status IncidentStatusEnum.Active.Pending - Although, I had some issues with null - quickly sorted by if (listitem["Status"] != null).

    So, in the end I addes this: 

    @{
        List<Dictionary<string, object>> sortList = ViewBag.RequestsList;
    
        string idClicked = ViewBag.ClickeID;
        var reqType = ViewBag.ReqType;
        var criteria = ViewBag.Criteria;
        string clicked_filter = ViewBag.ClickedFilter;
    
    foreach (Dictionary<string, object> listitem in sortList)
        {
    	if (listitem["Status"] != null){
            if (listitem["Status"].ToString().Equals("IncidentStatusEnum.Active.Pending"))
            {
                listitem["RequestStatus"] = Resources.SelfServicePortalResources.Active;
            }
    	}
        }
    
    }
    Hope it helps :)
    • Proposed as answer by Thor_E Friday, February 5, 2016 10:13 AM
    Friday, February 5, 2016 8:47 AM
  • Thanks, sortet our initial issue.

    For some reason, the User-input is never added into the inicident after we`ve mapped is as active.
    Friday, February 5, 2016 10:13 AM
  • I went to add the code under "additions" but I am not seeing anything with "changeStatusButtonText" within the RequestDetails.cshtml at all.  Is this another portion to add, and where would you add it in the .cshtml files?  Would it be at the top of the code above or below the "bool external = false;"?  Thank you for the help!
    Thursday, February 18, 2016 10:41 PM
  • You need to add the following to RequestDetails.cshtml:

    status = "Active";

    This helped me:

    https://social.technet.microsoft.com/Forums/systemcenter/en-US/6f849b29-c859-462a-ac7e-5277be4bb632/adding-user-comment-to-incident-doesnt-work-when-incident-is-not-active?forum=portals

    Friday, March 4, 2016 11:51 AM
  • Hi Abhishek,

    We do same but still the issue not solved code as below:

        <g class="gr_ gr_17 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="17" id="17">foreach</g> (Dictionary<string, object> <g class="gr_ gr_18 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="18" id="18">listitem</g> in sortList)
        {
            if (listitem["Status"].ToString().Equals("In progress"))
            {
                listitem["RequestStatus"] = Resources.SelfServicePortalResources.Active;
            }
        }

    and

    if (requestEntry["Status"].ToString().Equals("In progress"))
        {
            requestEntry["RequestStatus"] = Resources.SelfServicePortalResources.Active;
            changeStatusButtonText = Resources.SelfServicePortalResources.CancelRequest;
            changeStatusCommentPlaceholder = Resources.SelfServicePortalResources.AddCommentToCancel;
        }

    Thanks,

    Wednesday, October 5, 2016 12:55 PM