CA Service Management

Expand all | Collapse all

Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

  • 1.  Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 22, 2017 08:26 AM

    I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Using this I am getting old tickets:http://myserver:8050/caisd-rest/in 



  • 2.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Broadcom Employee
    Posted Sep 22, 2017 10:08 AM

    Nagarjuna,

     

    If you are trying to update a specific ticket, then you'd have to specific the URL of that ticket  (example:  http://SDMURL/caisd-rest/in/12345 and not the generic one ( http://SDMURL/caisd-rest/in )

     

    Then you can update the ticket 12345 with something like:

     

    <in>

     

    <description> updating via REST </description>

    </in>

     

     

    Hope this helps

    _R



  • 3.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 06:42 AM

    Hi Raghu,

    This is for updating purpose,

    But I need url to get the latest created tickets.

     

    Thanks,

    Nagarjuna.



  • 4.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Broadcom Employee
    Posted Sep 22, 2017 10:27 AM

    Nagarjuna, with the /in open query, your GET will return a lot of tickets and that is why you see old tickets. If you want to see new tickets or some specific tickets, then you would need to user WHERE clause. For example,

    http://myserver:8050/caisd-rest/in?WC=priority%3D1

    will return all incidents with priority=1

    Hope this helps. Thanks _Chi



  • 5.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Broadcom Employee
    Posted Sep 22, 2017 10:30 AM

    Sorry a mistake in my post...it should be

    http://myserver:8050/caisd-rest/in?WC=priority%3D5

    for priority=1 incidents not

    http://myserver:8050/caisd-rest/in?WC=priority%3D1



  • 6.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 06:43 AM

    Hi Chi chen,

    This is for getting tickets based on priority.

    But I want url for latest created tickets.

     

    Thanks,

    Nagarjuna.



  • 7.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Broadcom Employee
    Posted Sep 25, 2017 10:02 AM

    Nagarjuna, what tickets are "latest created tickets"? the tickets opened in the last week? last month? or last year?

    Thanks _Chi



  • 8.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 07:27 AM

    Hi.

    Could your problem be related to a wrong sorting order and the paginating ?

    By default many objects are sorted by their id value in a ascending order.

    Additionaly you only get the first 25 records as far as I am aware of.

    So try to use  the following :

    :http://myserver:8050/caisd-rest/in?SORT=id desc

    This should result in the 25 most recent incidents...

    Hope this helps

    Regards

    ............Michael



  • 9.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 08:58 AM

    Hi Michael,

    The problem is related to sorting order based on id.

    Using SORT=id desc, getting invalid url error.

     

    Thanks,

    Nagarjuna



  • 10.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 09:30 AM

    Hmm.

    It works for me quite well.

    what is different between your and mine test? Again my URL just for sure:

    http://server:port/caisd-rest/in?SORT=id desc

     

    Regards

    ........Michael



  • 11.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 09:36 AM

    This is a Screenshot of my Soap ui test:



  • 12.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.

    Posted Sep 25, 2017 09:48 AM

    you might have to escape the space between id and desc:

    http://server:port/caisd-rest/in?SORT=id%20desc

     

    Regards

    ..........Michael



  • 13.  Re: Hi, I am using REST API call to get the tickets, in this case i am getting old tickets, But I want latest updated tickets using the REST API call, can u help me on this.
    Best Answer

    Posted Sep 26, 2017 02:04 AM

    Hi Michael,

    It is working now.

     

    Thank you so much,

    Nagarjuna.