Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
This page is about Assets & Inventory Plugin for Jira DC. Using Cloud? Click here. |
This document describes the REST Services services for managing assets in the system. Authentication is required for all calls.
On this page:
|
---|
System Fields and Attributes on Create or Update
System Fields
Display Name | Field Name | Field Type | Description | Example |
---|---|---|---|---|
Status | asset.status | STRING | The value must be the key of Status or display the name of the Status. (Please see {{link}} for Status keys) | "1" or "In stock" |
Substatus | asset.substatus | STRING | The value must be the key of Substatus or display the name of the Substatus. (Please see {{link}} for Substatus keys) | "1" or "Available" |
Assignee | asset.assignee | JIRA_USER | The value must be a username or user key. | "tdurden" or "JIRAUSER10000" |
Reserved for | asset.reservedFor | JIRA_USER | The value must be a username or user key. | "tdurden" or "JIRAUSER10000" |
Owner | asset.owner | JIRA_USER | The value must be a username or user key. | "tdurden" or "JIRAUSER10000" |
Managed by | asset.managedBy | JIRA_USER | The value must be a username or user key. | "tdurden" or "JIRAUSER10000" |
Quantity | asset.quantity | LONG | The value must be a number (without decimals). | 14 |
Asset tag | asset.assetTag | STRING | The value must be a text. | "tag1" |
Serial Number | asset.serialNumber | STRING | The value must be a text. | "AB12309712947" |
Location | asset.location | LONG | The value must be the ID of the location or the name of the location. | "3" or "Istanbul Office" |
Belongs to group | asset.belongsToGroup | STRING | The value must be a List of Jira Group in JSON format. | "["jira-administrators"]" or "["jira-developers","jira-users"]" |
Install Date | asset.installDate | DATE | The value must be Date (without time) in ISO format. | "2020-05-22" |
Cost | asset.cost | DOUBLE | The value must be a number float(with decimals). | 34.12 |
Currency | asset.costCurrency | STRING | The value must be one of the currencies. | "USD" or "EUR" |
Invoice Number | asset.invoiceNumber | STRING | The value must be a text. | "IN12093821907049712409" |
Attributes
Type | Description | Example |
---|---|---|
Asset List | The value must be ID of asset or name of asset. If there are multiple values, you must add "," between values. | "145" |
Asset List by Asset Types | The value must be ID of asset or name of asset. Asset must be in given Asset Type. If there is multiple value, you must add "," between values. | "145" |
Cascading Dropdown | The value must be cascading dropdown option ids. Add "-" between options. | "1-2" |
Checkbox | The value must be one of checkbox values. If there are multiple values, you must add "@@@@@@" between them. | "Ada" |
Date Picker | The value must be Date(without time) in ISO format. | "2020-05-22" |
Date Time Picker | The value must be Date-time(with time) in ISO format. | "2020-05-22T13:18" |
Dropdown List | The value must be one of Dropdown List values. | "Ada" |
Encrypted | The value must be text. | "password123" |
IP | The value must be text. | "192.168.1.1" |
IPv6 | The value must be text. | "2607:f0d0:1002:0051:0000:0000:0000:0004" |
Jira Organizations | The value must be one of Jira Organization IDs. If there are multiple values, you must add "@@@@@@" between them. Refer to this documentation to figure out how to get Jira Organization IDs. | "1" "1@@@@@@2" |
Jira Project | The value must be one of Jira Project IDs. If there are multiple values, you must add "@@@@@@" between them. Refer to this documentation to figure out how to get Jira Organization IDs. | "10000" "10000@@@@@@10001" |
Jira Project Components | The value must be one of "Jira Project Id - Jira Project Component Id". If there are multiple values, you must add "@@@@@@" between them. Refer to this documentation to figure out how to get Jira Organization IDs. | "10000-1" "10000-1@@@@@@100001-2" |
Jira Project Versions | The value must be one of "Jira Project Id - Jira Project Version Id". If there are multiple values, you must add "@@@@@@" between them. Refer to this documentation to figure out how to get Jira Organization IDs. | "10000-1" "10000-1@@@@@@100001-2" |
Jira User Picker | The value must be a username. It doesn't need to be a Jira User. | "tyler-durden" |
List Box | The value must be one of List Box values. | "Mer" |
List Box - Multiple | The value must be one of List Box values. If there are multiple values, you must add "@@@@@@" between them. | "Izm" |
Number Float(with decimals) | The value must be number float(with decimals). | 14.2 |
Number Long(without decimals) | The value must be number long(without decimals). | 98 |
Radio Button | The value must be one of Radio Button values. | "Can" |
Text | The value must be text. | "Lorem ipsum dolor sit amet, consectetur adipiscing elit." |
Text Area | The value must be text. | "Lorem ipsum dolor sit amet, consectetur adipiscing elit." |
URL | The value must be text. | "https://appfire.com/" |
Listing all assets
Only Jira Admins can use this Rest Service. Please use the Search service, which is better in performance, and no Jira Admin user is required.
Method | GET |
---|---|
URL | /rest/jip-api/1.0/inventory/list.json |
Expand | ||
---|---|---|
| ||
|
List single asset
Method | GET |
---|---|
URL | /rest/jip-api/1.0/inventory/[assetID].json |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Filtering assets
Only Jira Admins can use this Rest Service. Please use the Search service, which is better in performance, and no Jira Admin user is required.
Method | POST |
---|---|
URL | /rest/jip-api/1.0/inventory/filter.json |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Create a new asset
Method | POST |
---|---|
URL | /rest/jip-api/1.0/inventory/asset.json |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Update asset
Method | PUT |
---|---|
URL | /rest/jip-api/1.0/inventory/asset/[assetID].json |
"Name" is required. If you don't send it, the asset name will be cleared. Attributes are optional. You can send only the system fields and attributes you need to update.
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Delete asset
Method | DELETE |
---|---|
URL | /rest/jip-api/1.0/inventory/[assetID].json |
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
Add attachment to an asset
Method | POST |
---|---|
URL | rest/jip-api/1.0/inventory/attachment/0/[assetID].json |
Headers | Content-Type: multipart/form-data |
Notes:
It is not possible to create an asset with attachments; first, the asset needs to be created, and then attachments can be uploaded after that.
Zero in URL is a fixed value.
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
|
The data attribute holds metadata of all asset attachments.
Expand | ||
---|---|---|
| ||
|
You can inspect the browser to see it in action. Open the app, inspect the browser, and then upload an attachment. Here are some example screenshots from Chrome:
Request:
Response:
Delete attachment from an asset
Method | DELETE |
---|---|
URL | /rest/jip-api/1.0/inventory/detachFile/0/[assetID]/[serverFileName].json Example: /rest/jip-api/1.0/inventory/detachFile/0/20711/75144_11677_1620987178043.png.json |
Get attachment of an asset
Method | GET |
---|---|
URL | /rest/jip-api/1.0/inventory/getFile/0/[assetID]/[serverFileName].json Example: [JIRA_BASE]/rest/jip-api/1.0/inventory/getFile/0/20711/91697_10383_1620986690368.jpg.json |
Attachments is an asset JSON attribute. It is encoded as a String; you need to decode it to JSON back, and serverFileName can be obtained from there.
The following response example of Get Asset API ([JIRA_BASE]/rest/jip-api/1.0/inventory/transformed/[assetID].json
) has an attachments attribute.
Expand | ||
---|---|---|
| ||
|