Asset search REST services

This page is about Assets & Inventory Plugin for Jira DC. Using Cloud? Click here.

User of the REST API caller needs the Browse Asset permission to fetch results.

API definition

Method

POST

URL

/rest/jip-api/1.0/index/query.json

Request Headers:

  • Content-Type: application/json

  • Authorization:  Basic hash of user name and password. For example, Basic YWRtaW46YWRtaW4=.

Post parameters

Parameter

Type

Example

Description

Parameter

Type

Example

Description

searchType

String

basic

Fixed value.

listType

String

detail

Fixed value.

genericKeyword

String



For advanced manual Lucene Query. Leave it null to use queryIndexSearchParams.

queryIndexSearchParams

List of QueryIndexSearchParam



List of search criteria.

mandatoryQueryIndexSearchParams

List of QueryIndexSearchParam



These search criteria will be AND with queryIndexS earchParams.

orForQueryIndexSearchParams

Boolean

true/false

Decides whether there will be OR or AND between queryIndexSearchParams.

orForMandatoryQueryIndexSearchParams

Boolean

true/false

Decides whether there will be OR or AND between mandatoryQueryIndexSearchParams.

pageNumber

Integer

1

Page number of the results. Results will return as paged.

pageSize

Integer

15

Size of page.

sortDirection

String

asc/desc

asc or desc.

sortField

String

asset.name

Field to sort. Use System Fields or Attribute names.

sortType

String

STRING

Use one of search field types.

QueryIndexSearchParam

Parameter

Type

Example

Description

Parameter

Type

Example

Description

field

String

External System Id

Field to search. Attribute name or System Fields are valid.

keyword

String

AB001

Wildcard search is supported. For example, Tom* or Tom?.

keywords

List of String

["AB", "XDVl", "DRR"]

Use this field for LIST, ALL_ASSETS_REF, and ASSETS_REF_BY_FORM field types searches.

minNum

Float

1 or 10.5

Use this field for LONG and DOUBLE field types. For exact search, set range to false and use minNum field.


maxNum

Float

1 or 10.5

Use this field for LONG and DOUBLE field types. For exact search, set range to false, use minNum field, and set maxNum to null.

minDate

String

2019-05-29T11:49

or

2019-05-29

Use this field for DATE and DATE_TIME field types. Use ISO time format.

For exact search, set range to false and use minDate field.

maxDate

String

2019-05-29T11:49

or

2019-05-29

Use this field for DATE and DATE_TIME field types. Use ISO time format.

For exact search, set range to false, use minDate field, and set maxDate to null.

relativeMin

String

1d or -2w

Use this field for DATE and DATE_TIME field types. This parameter is for a dynamic search. 

  • -1w is for 1 week earlier when the search is performed.

  • Set relative to true.

  • For exact search, set range to false and use minDate field.

relativeMax

String

3y or -4m

Use this field for DATE and DATE_TIME field types. This parameter is for a dynamic search. 

  • -1w is for 1 week earlier when the search is performed.

  • Set relative to true.

  • For exact search, set range to false, use minDate field, and set maxDate to null.

fieldType

String

STRING

One of Search Field Types.

relative

boolean

true/false

For relative date search, set true.

range

boolean

true/false

For date and numeric RANGE searches. Set false for exact search.

searchEmpty

boolean

true/false

Set this field true to make Is empty search.

not

boolean

true/false

Set this field true to make Not includes search.

Search Field Types

Field Type (use capital case)

 

Field Type (use capital case)

 

LIST

List type of Attributes.

LIST_OF_LONG

List of long.

STRING

Text field.

JIRA_USER

Jira User's user key or $currentUser.

DATE

Date field without time.

DATE_TIME

Date field with time.

LONG

Numeric long value. For example, 1001.

DOUBLE

Numeric Double/Float value. For example, 100.12.

ALL_ASSETS_REF

Asset reference Attribute type.

ASSETS_REF_BY_FORM

Asset reference filtered with asset type attribute type.

URL

URL field.

System Fields

These fields are available to search and sort.

System Field Name

Field Type

Description

System Field Name

Field Type

Description

asset.content

STRING

Any field. Search for any field including system fields and attributes.

scheme.id

LONG

Asset type scheme ID.

scheme.name

LIST

Asset type scheme name.

form.id

LONG

Asset type ID (formerly FORM).

form.name

LIST

Asset type name (formerly FORM).

asset.id

LONG

Asset ID.

asset.name

STRING

Asset name.

asset.attachment

STRING

Attachment filename (not content of the file).

asset.creator

STRING

User name of the user who created the asset.

asset.created

DATE_TIME

The asset’s time of creation.

asset.status

STRING

The keyword must be a status key.

asset.substatus

STRING

The keyword must be a substatus key.

asset.assignee

JIRA_USER

The keyword must be a user key.

asset.reservedFor

JIRA_USER

The keyword must be a user key.

asset.owner

JIRA_USER

The keyword must be a user key.

asset.managedBy

JIRA_USER

The keyword must be a user key.

asset.quantity

LONG

The keyword must be a number long (without decimals).

asset.assetTag

STRING

The keyword must be text.

asset.serialNumber

STRING

The keyword must be text.

asset.location

LONG

The keyword must be a location ID.

asset.belongsToGroup

STRING

The keyword must be a List of Jira Group in JSON format.

asset.installDate

DATE

The keyword must be Date (without time) in ISO format.

asset.cost

DOUBLE

The keyword must be a number float (with decimals). 

asset.costCurrency

STRING

The keyword must be one of the currencies.

asset.invoiceNumber

STRING

The keyword must be text.

Attributes

Type

Description

Example

Type

Description

Example

Asset List

The keyword must be "name + #ID" of an asset.

"Laptop 1 #167"

Asset List by Asset Types

The keyword must be "name + #ID" of an asset.

"Laptop 1 #167"

Cascading Dropdown

The keyword must be text.

"1-2"

Checkbox

The keyword must be text.

"Ada"

Date Picker

The keyword must be Date (without time) in ISO format.

"2020-05-22"

Date Time Picker

The keyword must be Date-time (with time) in ISO format.

"2020-05-22T13:18"

Dropdown List

The keyword must be text.

"Ada"

IP

The keyword must be text.

"192.168.1.1"

IPv6

The keyword must be text.

"2607:f0d0:1002:0051:0000:0000:0000:0004"

Jira Organizations

The keyword must be text.

"1"

Jira Project

The keyword must be text.

"10000"

Jira Project Components

The keyword must be text.

"10000-1"

Jira Project Versions

The keyword must be text.

"10000-1"

Jira User Picker

The keyword must be a username.

"tyler-durden"

List Box

The keyword must be text.

"Mer"

List Box - Multiple

The keyword must be text.

"Izm"

Number Float(with decimals)

The keyword must be number float (with decimals).

14.2

Number Long(without decimals)

The keyword must be number long (without decimals).

98

Radio Button

The keyword must be text.

"Can"

Text

The keyword must be text.

"Lorem ipsum dolor sit amet, consectetur adipiscing elit."

Text Area

The keyword must be text.

"Lorem ipsum dolor sit amet, consectetur adipiscing elit."

URL

The keyword must be text.

"https://snapbytes.com/"

Status and Substatus Keys

Status Keys

Display Name

Key

Display Name

Key

In stock

1

In use

2

In transit

3

On order

4

In maintenance

5

Retired

6

Missing

7

Substatus Keys

Display Name

Key

Display Name

Key

Available

1

Reserved

2

Defective

3

Pending repair

4

Pending install

5

Pending disposal

6

Pending transfer

7

Pre-allocated

8

Lost

9

Stolen

10

Examples

For more examples, use the Asset Navigator to conduct on-screen searches and then inspect the corresponding page. Locate the query Network call and examine both its Request and Responses. Begin by conducting a screen search to pinpoint the specific example that aligns with your system and required fields.

Search for one String field

{ "searchType": "basic", "listType": "detail", "genericKeyword": null, "queryIndexSearchParams": [ { "field": "External System Id", "keyword": "1012", "keywords": [], "fieldType": "STRING", "range": true } ], "pageNumber": 1, "pageSize": 15, "sortDirection": "asc", "sortField": "asset.name", "sortType": "STRING", "respTime": 1558685025363 }
{ "queryIndexParam": { "searchType": "basic", "listType": "detail", "genericKeyword": null, "queryIndexSearchParams": [ { "field": "External System Id", "fieldLabel": null, "keyword": "1012", "keywords": [], "fieldType": "STRING", "minNum": null, "maxNum": null, "minDate": null, "maxDate": null, "range": true } ], "pageNumber": 1, "pageSize": 15, "sortDirection": "asc", "sortField": "asset.name", "sortType": "STRING", "respTime": 1558685031755 }, "recordIds": [ null ], "queryPagingInfo": { "pageRecordSize": 1, "totalRecords": 1, "totalPages": 1, "pageNumber": 1, "pageSize": 15, "hasNext": false }, "assets": [ { "id": 21, "name": "Printer002", "sortOrder": 0, "objectSchemaId": 1, "objectSchemaName": "Default Asset Scheme", "formId": 6, "formName": "Printers", "created": null, "createdFormatted": null, "creator": null, "attachments": "[ ]", "inventoryItems": [ { "value": "1012", "attributeName": "External System Id", "attributeType": "Text", "inventoryRefs": [], "multiListValues": [], "attributeId": 84, "id": 1207, "formAttributeId": 397, "displayValue": "1012", "textValues": "1012", "isoDateValue": null }, { "value": "12685-3434-4522-1335", "attributeName": "Serial Number", "attributeType": "Text", "inventoryRefs": [], "multiListValues": [], "attributeId": 7, "id": 153, "formAttributeId": 33, "displayValue": "12685-3434-4522-1335", "textValues": "12685-3434-4522-1335", "isoDateValue": null }, { "value": "HP", "attributeName": "Vendor", "attributeType": "DropdownList", "inventoryRefs": [], "multiListValues": [], "attributeId": 61, "id": 1209, "formAttributeId": 398, "displayValue": "HP", "textValues": "HP", "isoDateValue": null }, { "value": "HP 4665", "attributeName": "Model", "attributeType": "Text", "inventoryRefs": [], "multiListValues": [], "attributeId": 18, "id": 155, "formAttributeId": 35, "displayValue": "HP 4665", "textValues": "HP 4665", "isoDateValue": null } ], "customfieldId": "customfield_10100", "optionId": 10303, "inventoryItemListSize": 4 } ] }

Search for Asset Type Scheme, Asset Type, Asset Name, Asset ID

{ "searchType": "basic", "listType": "detail", "genericKeyword": null, "queryIndexSearchParams": [ { "field": "asset.id", "keyword": "", "keywords": [], "fieldType": "LONG", "minNum": 1, "maxNum": 200, "minDate": null, "maxDate": null, "range": true }, { "field": "asset.name", "keyword": "tom*", "keywords": null, "fieldType": "STRING", "minNum": null, "maxNum": null, "minDate": null, "maxDate": null, "range": false }, { "field": "form.name", "keyword": null, "keywords": [ "Servers" ], "fieldType": "LIST", "minNum": null, "maxNum": null, "minDate": null, "maxDate": null, "range": false }, { "field": "scheme.name", "keywords": [ "Default Asset Scheme" ], "fieldType": "LIST" } ], "pageNumber": 1, "pageSize": 15, "sortDirection": "asc", "sortField": "asset.name", "sortType": "STRING", "respTime": 1558688161063 }

Search for any field including all attributes and system fields

Search for one asset with asset ID 

Search for Asset Reference Type  

Search for Status and Substatus (System Field)

Search for All Fields