Table of Contents |
---|
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. Example: Basic YWRtaW46YWRtaW4=
Post parameters
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 queryIndexSearchParams | |
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 | Field to sort. Use system fields or attribute names. | |
sortType | String | STRING | Use one of search field types. |
QueryIndexSearchParam
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. i.e 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 and 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 and 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 and 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) | |
---|---|
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, i.e. 1001 |
DOUBLE | Numeric Double/Float value, i.e. 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 |
---|---|---|
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 how created asset. |
asset.created | DATE_TIME | Create date time of asset |
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 |
---|---|---|
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 |
---|---|
In stock | 1 |
In use | 2 |
In transit | 3 |
On order | 4 |
In maintenance | 5 |
Retired | 6 |
Missing | 7 |
Substatus Keys
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, you can use Asset Navigator UI to search on screen and then inspect on page. Locate "query" Network call and see Request and Responses. So first do a screen search and find the real example meeting your system and fields.
...