Skip to main content
Matrix42 Self-Service Help Center

Close a Task

Details

Closes a task by setting task status to "Close". 

Request

URL

POST https://{server_name}/m42Services/api/task/close

Headers

For a list of available HTTP request headers see Web Services: REST API integration.

POST body

Element Description Type Required
ObjectIds Array of GUIDs of the tasks to be closed. Array of GUIDs Required
Comments HTML formatted text for the task solution string Required
Reason

specifies a reason for the closed task. Possible reason values and meaning:

  • 401:  Expiration Date Reached;
  • 402: Solved;
  • 403: Workaround;
  • 404: Rejected;
  • 405: Not Reproductible;
  • 406: Duplicate;
  • 407: Other;
  • 408: Direclty Solved (default);
  • 409: Obsolete;
  • 410: RFC Created;
  • 411: Retracted;
  • 412: Aborted;
  • 413: Known Error.
integer Optional
CategoryId
  • not specified: inherits  the current value from the Problem;
  • GUID of an incident category classification.

All available category GUIDs can be retrieved by get a list of fragments method from SPSScCategoryClassBase fragment, ID element. 

GUID Optional
KBArticle

GUID identifier of the existing knowledge base article that should be related to the closed task.

All available knowledge base article GUIDs can be retrieved by get a list of fragments method from SVMKBArticleClassBase  fragment, ArticleID element. 

GUID Optional
Task-related user e-mail notification settings
SendMailToUsers
  • Not specified:  inherits the current value  of the task;
  • True: send an email to the user(s) who were added to the task as related or attached users
  • False: disable email notification;
boolean Optional
SendMailToInitiator
  • Not specified:  inherits the current value  of the task;
  • True: send an email to the user who is assigned as an initiator of the task;
  • False: disable email notification;
boolean Optional
NotifyResponsible
  • Not specified:  inherits the current value  of the task;
  • True: send an email to the user who is set as Responsible for the task;
  • False: disable email notification;
boolean Optional
InformFurtherUsers

users that should be additionally notified of the closed task via email.

Specify GUIDs of the users who are to receive a one-time email notification about the closed task(s).

All available user GUIDs can be retrieved by get a list of fragments method from SPSUserClassBasefragment. 

array of GUIDs Optional

SendMailToRelatedResponsibleUsers

  • Not specified:  inherits the current value  of the task;
  • True:  Inform responsible users of the related tasks about the closing of the current task. Related tasks and any other types of related activities are added via task "Topics" menu;
  • False: disable email notification.
boolean Optional

Sample Request

POST https://{server_name}/m42Services/api/task/close

Authorization: Bearer YWsamplezhZARaccessGDuctoken2sYW1

Content-Type: application/json;charset=UTF-8

{  
   "ObjectIds":[  
     "0dd1548e-bbec-c1b5-7d27-08d6a253fcc4"
   ],
   "Comments":"<p>Task solution text<p>",
   "Reason":408,
   "CategoryId":"D0F04F85-458F-40BD-AEB0-E97B08B933B5",
   "KBArticle":"0dd1548e-bbec-c1b5-7d27-08d6a253fcc4",
   "SendMailToUsers":true,
   "SendMailToInitiator":true,
   "NotifyResponsible":true,
   "InformFurtherUsers":[  
      "938a1d78-bde2-4270-9892-402889a263f3"
   ],
   "SendMailToRelatedResponsibleUsers":true
}

Response

The server does not return any response.

Status codes and errors

Code Message
204 No content indicates that the server has successfully fulfilled the request and that there is no content to send in the response payload body.
400 Bad Request specifies missing required parameters and arguments of the body message.
500 Internal server error
  • Close operation failed as the task has already been closed;
  • Object reference not set to an instance of an object: specified Object ID was not found.
  • Was this article helpful?