Page tree
Skip to end of metadata
Go to start of metadata

System Fields and Attributes on Create or Update

System Fields

Display NameField NameField TypeDescriptionExample
Status
asset.status
STRING

The value must be key of Status or display name of Status

(Please see {{link gelecek}} for Status keys)

"1" or "In stock"
Substatus
asset.substatus
STRING

The value must be key of Substatus or display name of Substatus

(Please see {{link gelecek}} 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 number long(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 ID of the location or 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 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

TypeDescriptionExample
Asset ListThe value must be ID of asset or name of asset. If there are multiple values, you must add "," between values.
Note: If there is multiple asset with same name, first match will be saved to asset. So, using ID will be better for this field.

"145"
"145,456,189"
"Laptop 1,Laptop 2"

Asset List by Asset TypesThe 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. 
Note: If there is multiple asset with same name, first match will be saved to asset. So, using ID will be better for this field.
"145"
"145,456,189"
"Laptop 1,Laptop 2"
CheckboxThe value must be one of checkbox values. If there are multiple values, you must add "@@@@@@" between them.

"Ada"
"Ada@@@@@@Bal"

Date PickerThe value must be Date(without time) in ISO format."2020-05-22"
Date Time PickerThe value must be Date-time(with time) in ISO format."2020-05-22T13:18"
Dropdown ListThe value must be one of Dropdown List values. "Ada"
"Bal"
IPThe value must be text."192.168.1.1"
IPv6The value must be text."2607:f0d0:1002:0051:0000:0000:0000:0004"
Jira User PickerThe value must be a username. It doesn't need to be a Jira User."tyler-durden"
List BoxThe value must be one of List Box values. "Mer"
List Box - MultipleThe value must be one of List Box values. If there are multiple values, you must add "@@@@@@" between them.

"Izm"
"Izm@@@@@@Ist@@@@@@Mug"

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 ButtonThe value must be one of Radio Button values."Can"
TextThe value must be text."Lorem ipsum dolor sit amet, consectetur adipiscing elit."
Text AreaThe value must be text."Lorem ipsum dolor sit amet, consectetur adipiscing elit."
URLThe value must be text."https://snapbytes.com/"

Listing all assets

MethodGET
URL/rest/jip-api/1.0/inventory/list.json


Sample Response
[
  {
    "id": 12,
    "name": "Alpha Database Server",
    "formId": 2,
    "sortOrder": 0,
    "attributes": [
      {
        "id": 120,
        "attribute": {
          "attributeName": "Serial Number",
          "attributeType": "Text",
          "id": 7
        },
        "attributeValue": "3243-34343-434-2344"
      },
      {
        "id": 121,
        "attribute": {
          "attributeName": "IP",
          "attributeType": "Text",
          "id": 6
        },
        "attributeValue": "10.10.13.24"
      },
      {
        "id": 122,
        "attribute": {
          "attributeName": "Server Name",
          "attributeType": "Text",
          "id": 5
        },
        "attributeValue": "gollum"
      }
    ]
  },
  {
    ...
  }
]

List single asset

MethodGET
URL/rest/jip-api/1.0/inventory/[inventoryId].json


Sample Response
{
  "id": 1,
  "name": "Alpha Tomcat Server",
  "formId": 2,
  "sortOrder": 0,
  "attributes": [
    {
      "id": 1,
      "attribute": {
        "attributeName": "Server Name",
        "attributeType": "Text",
        "id": 5
      },
      "attributeValue": "cyrus"
    },
    {
      "id": 2,
      "attribute": {
        "attributeName": "IP",
        "attributeType": "Text",
        "id": 6
      },
      "attributeValue": "10.10.13.21"
    },
    {
      "id": 3,
      "attribute": {
        "attributeName": "Serial Number",
        "attributeType": "Text",
        "id": 7
      },
      "attributeValue": "1254-4432-3455-6642"
    }
  ]
}
Failure Message
{
  "success": false,
  "message": "Could not find inventory with id:[id]
}

Filtering assets

MethodPOST
URL/rest/jip-api/1.0/inventory/filter.json


Request Body(Filtering by only attribute)
{
  "attributeId": 2,
  "attributeValue": "Value to filter"
}
Request Body(Filtering by only asset type)
{
  "formId": 3
}
Request Body(Filtering by asset name)
{
  "name": "Kevin's computer"
}
Request Body(Filtering by asset type and attribute)
{
  "formId": 3,
  "attributeId": 15,
  "attributeValue": "Optical Mouse"
}
Possible Failure Messages
{
  "success": false,
  "message": "[formId] or [attributeId] should be specified"
}

Create a new asset

MethodPOST
URL/rest/jip-api/1.0/inventory/asset.json


Request Body
{
    "name": "Asset with all type of field 1",
    "attributes": [
        {
            "attributeId": "1233",
            "attributeValue": "3320,3318"
        },
        {
            "attributeId": "1234",
            "attributeValue": "3187"
        },
        {
            "attributeId": "1242",
            "attributeValue": "Ada@@@@@@Bal"
        },
        {
            "attributeId": "1244",
            "attributeValue": "2020-05-05"
        },
        {
            "attributeId": "1245",
            "attributeValue": "2020-05-15T13:18"
        },
        {
            "attributeId": "1253",
            "attributeValue": "Ada"
        },
        {
            "attributeId": "1264",
            "attributeValue": "192.168.1.1"
        },
        {
            "attributeId": "1265",
            "attributeValue": "2607:f0d0:1002:0051:0000:0000:0000:0004"
        },
        {
            "attributeId": "1269",
            "attributeValue": "tyler-durden"
        },
        {
            "attributeId": "1277",
            "attributeValue": "Mer"
        },
        {
            "attributeId": "1278",
            "attributeValue": "Izm@@@@@@Ist@@@@@@Mug"
        },
        {
            "attributeId": "1291",
            "attributeValue": 14.2
        },
        {
            "attributeId": "1292",
            "attributeValue": 98
        },
        {
            "attributeId": "1299",
            "attributeValue": "Can"
        },
        {
            "attributeId": "1312",
            "attributeValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
        },
        {
            "attributeId": "1313",
            "attributeValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tristique lacus diam, faucibus pulvinar ipsum porta nec. Donec auctor semper ante, quis mollis nisi tristique a. Cras ac feugiat erat. Mauris consequat, nisl nec lacinia lacinia, erat ligula maximus velit, quis dignissim ex ex eu nunc. Donec viverra sapien in arcu elementum mattis. Maecenas ornare, turpis quis rutrum hendrerit, erat mi mattis lorem, interdum malesuada lorem eros at odio. Aliquam erat volutpat."
        },
        {
            "attributeId": "1315",
            "attributeValue": "https://snapbytes.com/"
        }
    ],
    "systemFields": [
        {
            "fieldName": "asset.status",
            "value": "1"
        },
        {
            "fieldName": "asset.substatus",
            "value": "1"
        },
        {
            "fieldName": "asset.costCurrency",
            "value": "USD"
        },
        {
            "fieldName": "asset.assignee",
            "value": "JIRAUSER18000"
        },
        {
            "fieldName": "asset.owner",
            "value": "admin"
        },
        {
            "fieldName": "asset.managedBy",
            "value": "agrant-sd-demo"
        },
        {
            "fieldName": "asset.belongsToGroup",
            "value": "[\"jira-administrators\"]"
        },
        {
            "fieldName": "asset.quantity",
            "value": 1
        },
        {
            "fieldName": "asset.assetTag",
            "value": "Tag 1"
        },
        {
            "fieldName": "asset.serialNumber",
            "value": "AS123A9812947"
        },
        {
            "fieldName": "asset.installDate",
            "value": "2020-05-01"
        },
        {
            "fieldName": "asset.location",
            "value": 3
        },
        {
            "fieldName": "asset.cost",
            "value": 1999.99
        },
        {
            "fieldName": "asset.invoiceNumber",
            "value": "AS12037129370AF012937129037"
        }
    ],
    "formId": 490,
    "attachments": null
}
Success Response
{
    "success": true,
    "message": "Inventory[Asset with all type of field 1] created successfully",
    "id": 3378,
    "name": "Asset with all type of field 1"
}
Possible Failure Messages
{
  success: false,
  message: "[name] should not be empty"
}
{
  success: false,
  message: "[formId] should not be empty"
}
{
  success: false,
  message: "Form[formId] could not be found"
}
{
  success: false,
  message: "Form[formName] does not have an attribute with id:[attributeId]"
}
{
  "success": false,
  "message": "Attribute[attributeName] does not have a defined value[attributeValue]"
}
{
  "success": false,
  "message": "You may define at least one inventory attribute"
}

Update asset

MethodPUT
URL/rest/jip-api/1.0/inventory/asset/[inventoryId].json


"Name" is required, if you won't send it, asset name will be cleared. Attributes are optional. You can send only the system fields and attributes you need to update.

Request Body
{
    "name": "Asset with all type of field 2",
    "attributes": [
        {
            "attributeId": "1233",
            "attributeValue": "3320"
        },
        {
            "attributeId": "1234",
            "attributeValue": "3187,3200"
        },
        {
            "attributeId": "1242",
            "attributeValue": "Izm"
        },
        {
            "attributeId": "1244",
            "attributeValue": "2020-05-25"
        },
        {
            "attributeId": "1245",
            "attributeValue": "2020-06-12T14:08"
        },
        {
            "attributeId": "1253",
            "attributeValue": "Bal"
        },
        {
            "attributeId": "1264",
            "attributeValue": "192.168.1.2"
        },
        {
            "attributeId": "1265",
            "attributeValue": "2607:f0d0:1002:0051:0000:0000:0000:0005"
        },
        {
            "attributeId": "1269",
            "attributeValue": "agrant-sd-demo"
        },
        {
            "attributeId": "1277",
            "attributeValue": "Bal"
        },
        {
            "attributeId": "1278",
            "attributeValue": "Mug"
        },
        {
            "attributeId": "1291",
            "attributeValue": 9.3
        },
        {
            "attributeId": "1292",
            "attributeValue": 42
        },
        {
            "attributeId": "1299",
            "attributeValue": "Izm"
        },
        {
            "attributeId": "1312",
            "attributeValue": "Lorem ipsum dolor sit amet"
        },
        {
            "attributeId": "1313",
            "attributeValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tristique lacus diam, faucibus pulvinar ipsum porta nec. Donec auctor semper ante, quis mollis nisi tristique a. Cras ac feugiat erat. Mauris consequat, nisl nec lacinia lacinia, erat ligula maximus velit, quis dignissim ex ex eu nunc. Donec viverra sapien in arcu elementum mattis."
        },
        {
            "attributeId": "1315",
            "attributeValue": "https://snapbytes.com/#home"
        }
    ],
    "systemFields": [
        {
            "fieldName": "asset.assignee",
            "value": "agrant-sd-demo"
        },
        {
            "fieldName": "asset.owner",
            "value": "jevans-sd-demo"
        },
        {
            "fieldName": "asset.managedBy",
            "value": "admin"
        },
        {
            "fieldName": "asset.status",
            "value": "2"
        },
        {
            "fieldName": "asset.substatus",
            "value": null
        },
        {
            "fieldName": "asset.reservedFor",
            "value": null
        },
        {
            "fieldName": "asset.quantity",
            "value": 2
        },
        {
            "fieldName": "asset.assetTag",
            "value": "Tag 2"
        },
        {
            "fieldName": "asset.serialNumber",
            "value": "AS123A9812948"
        },
        {
            "fieldName": "asset.installDate",
            "value": "2020-05-14"
        },
        {
            "fieldName": "asset.location",
            "value": 4
        },
        {
            "fieldName": "asset.cost",
            "value": 2999.99
        },
        {
            "fieldName": "asset.costCurrency",
            "value": "EUR"
        },
        {
            "fieldName": "asset.invoiceNumber",
            "value": "AS12037129370AF012937129038"
        }
    ],
    "id": 3377,
    "formId": 490
}
Success Message
{
    "success": true,
    "message": "Inventory[3377] updated successfully",
    "id": 3377,
    "name": "Asset with all type of field 2"
}
Possible Failure Messages
{
  "success": false,
  "message": "Could not find inventory with id:[id]"
}
{
  "success": false,
  "message": "Form[formName] does not have an attribute with id:[attributeId]"
}

Delete asset

MethodDELETE
URL/rest/jip-api/1.0/inventory/[inventoryId].json
Success Message
{
  "success": false
  "message": "Inventory[inventoryId] deleted successfully"
}
Possible Failure Messages
{
  "success": false
  "message": "Inventory[id] could not be found"
}

{
  "success":false,
  "message":"Could not find form with id:[formId]"
}
  • No labels