Support

Expand all | Collapse all

'include' in '/items' or '/abstractitems'

Jump to Best Answer
  • 1.  'include' in '/items' or '/abstractitems'

    Posted 01-23-2020 03:05
    I try to get item links using 'include' parameter but I do not manage to understand what shall be the content of the 'include' parameter. And I've not found any example.
    I've tried following without any success:
    • include=5
    • include=Related%20to
    • include=*
    • include=relationship.Related%20to
    Could somebody help me to find the right parameter value ?

    Thank you in advance.

    ------------------------------
    Christophe
    ------------------------------


  • 2.  RE: 'include' in '/items' or '/abstractitems'

    Posted 01-24-2020 10:06
    Hello @Christophe

    I consulted with one of our Developer Support Engineers and here is the insight:

    Examples include the links part of the json response. For example in the response body for /items it has the following below. so you can have data.createdBy as an include parameter, if you do a GET /items it includes the users that those items were created by. example usage is here as well: https://dev.jamasoftware.com/cookbook/#include-parameter

    "links": {
        "data.createdBy": {
          "type": "users",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/users/{data.createdBy}"
        },
        "data.childItemType": {
          "type": "itemtypes",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/itemtypes/{data.childItemType}"
        },
        "data.lock.lockedBy": {
          "type": "users",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/users/{data.lock.lockedBy}"
        },
        "data.fields.lookup4": {
          "type": "picklistoptions",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/picklistoptions/{data.fields.lookup4}"
        },
        "data.modifiedBy": {
          "type": "users",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/users/{data.modifiedBy}"
        },
        "data.location.parent.item": {
          "type": "items",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/items/{data.location.parent.item}"
        },
        "data.fields.lookup1": {
          "type": "picklistoptions",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/picklistoptions/{data.fields.lookup1}"
        },
        "data.project": {
          "type": "projects",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/projects/{data.project}"
        },
        "data.fields.lookup2": {
          "type": "picklistoptions",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/picklistoptions/{data.fields.lookup2}"
        },
        "data.fields.modifiedBy": {
          "type": "users",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/users/{data.fields.modifiedBy}"
        },
        "data.itemType": {
          "type": "itemtypes",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/itemtypes/{data.itemType}"
        },
        "data.location.parent.project": {
          "type": "projects",
          "href": "https://jama-jphang.jamacloud.com/rest/v1/projects/{data.location.parent.project}"
        }
      }


    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------



  • 3.  RE: 'include' in '/items' or '/abstractitems'

    Posted 01-24-2020 13:34
    Edited by Christophe Blanchard 01-24-2020 13:36
    Thank you @Chloe for this fast answer.

    Can you tell me whether it is possible to get relationships using this 'include' parameter ? I do not see any relationship in your example.

    Thank you in advance

    ------------------------------
    Christophe
    ------------------------------



  • 4.  RE: 'include' in '/items' or '/abstractitems'
    Best Answer

    Posted 01-27-2020 06:57
    Hi Christophe:

    I double checked and Relationships is not something which can be pulled in with the Include param. We do have a whole Relationship endpoint but, I can see how it would be faster with Include.

    Best,

    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------