rt

Update Owner field of RT Ticket via REST API 2.0


curl -X PUT 
  -H "Content-Type: application/json" 
  -d 
  '{ “Owner”: { "id" : "root" } }' 
  -H 'Authorization: token XXX_Token_XXX'
  'http://XXX_RT_URL_XXX/REST/2.0/ticket/6'

This command works for updating values of a ticket at the top level of JSON, but values such as 'Owner' fails. The documentation does not denote any method as to update these specific fields. What is the recommended way to update a ticket's Owner field via the Request Tracker REST API 2.0 (rt-extension-rest2)?


Solution

  • Try with the username as the value:

    curl -X PUT 
      -H "Content-Type: application/json" 
      -d 
      '{ “Owner”: "root" }' 
      -H 'Authorization: token XXX_Token_XXX'
      'http://XXX_RT_URL_XXX/REST/2.0/ticket/6'
    

    That should accept a username or user ID.