IBM Support

How to use JSON API to change status of a Work Order

How To


Summary

This document provides instructions to cancel a work order

Steps

1) Download RESTClient for Firefox

https://addons.mozilla.org/en-US/firefox/addon/restclient/

Click Add to Firefox

2) Click the RESTClient icon on upper right-hand corner of Firefox browser

Change the method to GET

Use the URL to get the work order record:

http://localhost:9080/maximo/oslc/os/mxwo?_lid=wilson&_lpwd=wilson&lean=1&oslc.select=*&oslc.where=wonum="WC6"

NOTE: replace the hostname, port number, and work order number with the appropriate ones

Click Send button

3) Go to the Response section and click Preview tab

This REST query returns the work order details.

Find the REST ID in the response:

 "href": "http:\/\/max76jap.au.ibm.com:80\/maximo\/oslc\/os\/mxwo\/_QkVERk9SRC9XQzY-",

  

4) Add the REST ID to the URL and run the query:

Change the method to GET

http://localhost:9080/maximo/oslc/os/mxwo/_QkVERk9SRC9XQzY-?_lid=wilson&_lpwd=wilson&lean=1

It returns the same response as the query.

5) Change the WO status by changing the Method to POST

Use the same URL as step 4:

http://localhost:9080/maximo/oslc/os/mxwo/_QkVERk9SRC9XQzY-?_lid=wilson&_lpwd=wilson&lean=1

Click "header" drop-down

Select "custom header"

Enter the following headers one by one:

1st header:

Name: x-method-override

Value: PATCH

2nd header:

Name: patchtype

Value: MERGE

3rd header:

Name: Content-Type

Value: application/json

Enter the following in the body textbox:

{"status": "CAN"}

6) Click Send button

7) Go back to Maximo

Status of work order "WC6” is in "CAN" status

Document Location

Worldwide

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS4RKY","label":"Maximo Integration Adapter"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

TPAEMIF

Document Information

Modified date:
09 February 2020

UID

ibm11846317