CA Service Management

 View Only

  • 1.  How to update status to 'Resolved' and insert comment same time via REST API

    Posted 24 days ago

    Hello folks, I am trying to transition a ticket to 'Resolved' status using the REST API.

    I need to include a comment in the same request because it is a required field.

    I encountered the following error; does anyone have any insights?



    ------------------------------
    Regards,
    Felipe Vandrilho

    Linkedin: https://www.linkedin.com/in/vandrilho/
    ------------------------------


  • 2.  RE: How to update status to 'Resolved' and insert comment same time via REST API
    Best Answer

    Broadcom Employee
    Posted 24 days ago

    Hi Filipe, 

    I think there might a misunderstanding, in REST you are not able to create an object from another object, It seems REST does not enforce the must_comment flag, it's the REST client's responsibility to ensure the app follows the restrictions.

    I was able to achieve the same outcome by making these calls:



    I hope this helps.


    -------------------------------------------



  • 3.  RE: How to update status to 'Resolved' and insert comment same time via REST API

    Posted 23 days ago

    I removed the required comment and works fine, thanks!



    ------------------------------
    Regards,
    Felipe Vandrilho

    Linkedin: https://www.linkedin.com/in/vandrilho/
    ------------------------------



  • 4.  RE: How to update status to 'Resolved' and insert comment same time via REST API

    Posted 23 days ago
    Edited by Jean-Pierre Marsan 23 days ago

    If you do that, I'm afraid you will get two "Resolved" activity logs. One with "This is an update" in the description, then the automatically generated activity log with "Status changed from 'XXXX' to 'Resolved'" in the description.

    If you absolutely need to post a resolution comment, and if you want to avoid having a duplicate activity log, you need to add "status_f":"1" to the PUT call to cr. That LOCAL attribute is designed to inhibit the "Update Status" activity log creation.

    The body of the POST to cr would be:

    {
       "cr":{
          "status":{
             "@REL_ATTR":"RE"
          },
          "status_f":"1"
       }
    }
    

    I hope this helps

    -------------------------------------------



  • 5.  RE: How to update status to 'Resolved' and insert comment same time via REST API

    Posted 23 days ago

    Hi Jean,

    Thanks, it's a good tip for avoid duplicate messages and we have a clean logs for status update.



    ------------------------------
    Regards,
    Felipe Vandrilho

    Linkedin: https://www.linkedin.com/in/vandrilho/
    ------------------------------