Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Generate an API Token:

    • Log in to your Jira Cloud account.

    • Navigate to Account Settings.

    • Select Security.

    • Click on Create and manage API tokens.

    • Generate a new API token and store it securely.

  2. Prepare Your Credentials:

    • Combine your email address and API token in the format:

      Code Block
      user@example.com:your_api_token
  3. Encode Credentials in Base64:

    • Use a Base64 encoder to encode the combined string.

    • For example, in Python:

      Code Block
      import base64 credentials = 'user@example.com:your_api_token' encoded_credentials = base64.b64encode(credentials.encode('utf-8')).decode('utf-8')
  4. Include in HTTP Authorization Header:

    • Add the following header to your API requests:

      Code Block
      Authorization: Basic encoded_credentials
      Domain: https://<your-domain>.atlassian.net

Example

...

If your email is user@example.com and your API token is abcd1234, your combined string is:

...

Code Block
Authorization: Basic dXNlckBleGFtcGxlLmNvbTphYmNkMTIzNA==
Domain: https://your-url.atlassian.net

Using the AssetType REST Endpoint

...

Code Block
GET https://checkout.mumosystems.com/rest/checkout/1.0/assettype

Parameters:

  • This endpoint does not require any query requires projectId parameters for a basic GET request.

Example Request Using cURL:

Code Block
curl -X GET 
\ 'https://checkout.mumosystems.com/rest/checkout/1.0/assettype?projectId=10001' 
\ -H 'Authorization: Basic dXNlckBleGFtcGxlLmNvbTphYmNkMTIzNA==' 
\ -H 'Domain: https://<your-domain>.atlassian.net/'
\ -H 'Content-Type: application/json'
Expand
titleExample Response

...

Code Block
[
  {
    "
id
originId": "
1
fd01b336-c6f6-430c-8646-fb55d877aafa",
    "name": "My Asset 
"Laptop", "description": "Portable computers" }, { "id": "2", "name": "Monitor", "description": "Display screens" }, { "id": "3", "name": "Keyboard", "description": "Input devices" } ]
  • The response is a JSON array of asset type objects, each containing:

    • id: The unique identifier of the asset type.

    • name: The name of the asset type.

    • description: A brief description of the asset type.

Example Request Using Python and Requests Library:

Code Block
languagepy
import requests import base64 # Your credentials email = 'user@example.com' api_token = 'your_api_token' credentials = f'{email}:{api_token}' encoded_credentials = base64.b64encode(credentials.encode('utf-8')).decode('utf-8') # Headers headers = { 'Authorization': f'Basic {encoded_credentials}', 'Content-Type': 'application/json' } # API URL url = 'https://your-domain.atlassian.net/rest/checkout/1.0/assettype' # Send GET request response = requests.get(url, headers=headers) # Check response if response.status_code == 200: asset_types = response.json() print(asset_types) else: print(f'Error: {response.status_code} - {response.text}')
Type",
    "image": "https://my-icon-url.org/",
    "description": "An asset type's description",
    "mapping": {
      "workspaceId": "1574",
      "schemaId": "1454",
      "typeId": "95472",
      "attributes": [
        {
          "assetAttrId": "cf89d9ee-a325-4baf-bafa-6813e8280116",
          "insightAttrId": "594197"
        }
      ]
    },
    "attributes": [
      {
        "id": "cf89d9ee-a325-4baf-bafa-6813e8280116",
        "providerId": null,
        "name": "Id",
        "dataType": "SHORT_TEXT",
        "description": null,
        "default": false,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "706c5e44-ea0a-41e2-99c3-9418f2998a8c",
        "providerId": null,
        "name": "Name",
        "dataType": "SHORT_TEXT",
        "description": "Asset name is the name by which the asset is know",
        "default": true,
        "required": true,
        "computable": true,
        "options": null
      },
      {
        "id": "serialNumber",
        "providerId": null,
        "name": "Serial Number",
        "dataType": "SHORT_TEXT",
        "description": "A serial number is a unique identifier assigned incrementally or sequentially to an item",
        "default": true,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "modelNumber",
        "providerId": null,
        "name": "Model Number",
        "dataType": "SHORT_TEXT",
        "description": "An identifier of a product given by its manufacturer",
        "default": true,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "98d8bdac-7ced-4c88-8454-8029563fee91",
        "providerId": null,
        "name": "Assignee",
        "dataType": "USER",
        "description": "Person who is assigned the asset",
        "default": true,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "itemId",
        "providerId": null,
        "name": "Item",
        "dataType": "ITEM",
        "description": "Reference Identifier to the Item",
        "default": true,
        "required": false,
        "computable": true,
        "options": null
      },
      {
        "id": "04156a2b-f01c-4644-bb02-5de24499d971",
        "providerId": null,
        "name": "Vendor",
        "dataType": "VENDOR",
        "description": "Reference Identifier to the Vendor",
        "default": true,
        "required": false,
        "computable": true,
        "options": null
      },
      {
        "id": "14e5757c-f7e4-4db8-8454-dce5e69abbee",
        "providerId": null,
        "name": "Status",
        "dataType": "DROPDOWN",
        "description": "Status for the asset",
        "default": true,
        "required": false,
        "computable": false,
        "options": [
          {
            "id": "5a359c94-e484-45d5-9bf0-01ac80431951",
            "value": "Inventory"
          },
          {
            "id": "efa72fe3-7d03-4b84-b000-4991a601d439",
            "value": "In Use"
          },
          {
            "id": "9b976433-4cb9-4bab-8d74-2db5466de00f",
            "value": "In Repair"
          },
          {
            "id": "7e5f9865-c379-4e4c-bc76-1628b106a134",
            "value": "Retired"
          }
        ]
      },
      {
        "id": "dateAssigned",
        "providerId": null,
        "name": "Date Assigned",
        "dataType": "DATE",
        "description": null,
        "default": false,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "deleted-at",
        "providerId": null,
        "name": "Date Deleted",
        "dataType": "DATE",
        "description": null,
        "default": false,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "issueKey",
        "providerId": null,
        "name": "Issue Key",
        "dataType": "SHORT_TEXT",
        "description": null,
        "default": false,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "projectId",
        "providerId": null,
        "name": "Project Id",
        "dataType": "SHORT_TEXT",
        "description": null,
        "default": false,
        "required": false,
        "computable": false,
        "options": null
      },
      {
        "id": "f5966e1b-04a3-4e7b-8aee-bc6165eb9aaf",
        "providerId": null,
        "name": "My Custom Number Type Att",
        "dataType": "NUMBER",
        "description": "My Custom Number Type Att",
        "default": false,
        "required": false,
        "computable": false,
        "options": []
      },
      {
        "id": "eac33e30-3756-4749-9376-53da1914e660",
        "providerId": null,
        "name": "Custom Option Group Field",
        "dataType": "DROPDOWN",
        "description": "Description",
        "default": false,
        "required": false,
        "computable": false,
        "options": [
          {
            "id": "15d0f8d3-c2b4-48c2-8076-4b5eb01f22e1",
            "value": "Opt 1"
          },
          {
            "id": "f8e4ba0b-1319-4efc-8646-dc6391fe37cb",
            "value": "Opt 2"
          },
          {
            "id": "989dde53-8b66-4dec-b5f4-4cb0f79055e0",
            "value": "Opt 3"
          }
        ]
      },
      {
        "id": "9d46aceb-243b-4981-803f-1577a100089b",
        "providerId": null,
        "name": "Custom Multi Select",
        "dataType": "MULTI_SELECT",
        "description": "Desc...",
        "default": false,
        "required": false,
        "computable": false,
        "options": [
          {
            "id": "3c67748c-f55e-4b4e-8f64-4cdc185a3507",
            "value": "Opt 1"
          },
          {
            "id": "f72badac-f21b-41d8-a7a1-89c7c76e9a63",
            "value": "Opt 2"
          },
          {
            "id": "d2c391b0-2fec-420a-84b6-4c40fe364b45",
            "value": "Opt 3"
          }
        ]
      },
      {
        "id": "5b84a65f-44ad-40b5-84aa-9beb4ee84fd3",
        "providerId": null,
        "name": "Custom Chekboxes",
        "dataType": "CHECKBOXES",
        "description": "Desc...",
        "default": false,
        "required": false,
        "computable": false,
        "options": [
          {
            "id": "0e0eaa9e-0c20-4021-89b3-270f8aadcedc",
            "value": "Checkbox 1"
          },
          {
            "id": "e1df0097-c464-4bc2-807d-96e591fd8650",
            "value": "Checkbox 2"
          },
          {
            "id": "a046fd7b-0401-4764-b49c-01575e9b1eb1",
            "value": "Checkbox 3"
          }
        ]
      }
    ]
  }
]

...