Versions Compared

Key

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

RMsis provides GraphQL API's on all major entities and relationships. You can use these API's to develop integrations between RMsis and other applications. This guide will help you to understand how to access and utilise these API's.

...

  1. RMsis API endpoint i.e. <JIRA_BASE_URL>/rest/service/latest/rmsis/graphql is part of RMsis plugin.
  2. So, you will need to access JIRA authentication API to receive authentication token and subsequently you can access RMsis API endpoint.
  3. If you do not have prior knowledge of accessing API in JIRA, please visit JIRA Server platform REST API reference

GraphQL

  1. RMsis uses GraphQL as its API standard
  2. GraphQL is query language for API's created by Facebook.
  3. You can learn more about GraphQL via specification http://facebook.github.io/graphql/ or example implementation https://github.com/facebook/graphql
  4. Some more getting started articles,

...

There are two main kind of resources available in RMsis, entities and relationships.

Entity

  1. All distinct and independent resources in RMsis are called entity.
  2. As RMsis imports some of them from JIRA, we can classify entities as internal and external.
  3. Internal Entities
    1. Requirement
      1. Planned
      2. Unplanned
    2. Release
    3. Test Case (Test Steps as its part)
    4. Test Run
  4. External Entity
    1. User
    2. Project
  5. In API's,
    1. For internal entities, all CRUD operations are provided, whereas,
    2. For external entities, only retrieve operation is provided (to get RMsis internal ID) and we encourage you to use JIRA Rest API's for other operations.

Relationship

  1. Links between entities is called relationship
  2. In API's, CRUD operations are provided for relationships

...

This section contains request and response samples based on current RMsis GraphQL implementation.

InformationRequest QueryResponse CodeResponse JSON
Fetch list of Priority in system


Code Block
languagejson
themeEmacs
collapsetrue
{
  getPriorities {
    id
    name
  }
}


200


Code Block
languagejson
themeEmacs
collapsetrue
{
  "data": {
    "getPriorities": [
      {
        "id": 1,
        "name": "Blocker"
      },
      {
        "id": 2,
        "name": "Critical"
      },
      {
        "id": 3,
        "name": "Major"
      },
      {
        "id": 4,
        "name": "Minor"
      },
      {
        "id": 5,
        "name": "Trivial"
      }
    ]
  }
}


Fetch list of Users available in RMsis


Code Block
languagejson
themeEmacs
collapsetrue
{
  getUsers {
    id
    externalId
  }
}


200


Code Block
languagejson
themeEmacs
collapsetrue
 {
  "data": {
    "getUsers": [
      {
        "id": 703,
        "externalId": "admin"
      },
      {
        "id": 699,
        "externalId": "userone"
      },
      {
        "id": 701,
        "externalId": "test"
      },
      {
        "id": 705,
        "externalId": "usertwo"
      }
    ]
  }
}


Fetch single requirement by ID


Code Block
languagejson
themeEmacs
collapsetrue
{
  getRequirementById(id: 1) {
    id
    summary
    description
    externalId
    createdAt
    categories {
      id
      name
    }
    reporter {
      id
    }
    priority {
      name
    }
  }
}


200


Code Block
languagejson
themeEmacs
collapsetrue
 {
  "data": {
    "getRequirementById": {
      "id": 1,
      "summary": "Requirement 1",
      "description": "Requirement <p>description</p>",
      "externalId": null,
      "createdAt": "22 Oct 1988 05:30 AM",
      "categories": [
        {
          "id": 1001,
          "name": "Category 1"
        },
        {
          "id": 1002,
          "name": "Category 2"
        }
      ],
      "reporter": {
        "id": 24
      },
      "priority": {
        "name": "Major"
      }
    }
  }
}


Fetch requirement by ID


Code Block
languagejson
themeEmacs
collapsetrue
{
  getRequirementById(id: 222) {
    id
    summary
  }
}


404


Code Block
languagejson
themeEmacs
collapsetrue
{
  "data": {
    "getRequirementById": null
  },
  "errors": [
    {
      "message": "Requirement with ID: 2 not found",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "getRequirementById"
      ]
    }
  ]
}


Create planned requirement


Code Block
languagejson
themeEmacs
collapsetrue
mutation {
  createPlannedRequirement(projectId: 709, summary: "New Requirement Summary") {
    id
    summary
    createdAt
  }
}


200


Code Block
languagejson
themeEmacs
collapsetrue
{
  "data": {
    "createPlannedRequirement": {
      "id": 2,
      "summary": "New Requirement Summary",
      "createdAt": "16 Apr 2018 12:55 PM"
    }
  }
}


Delete Test Case


Code Block
languagejson
themeEmacs
collapsetrue
mutation {
  deleteTestCase(id: 5)
}


200


Code Block
languagejson
themeEclipse
collapsetrue
{
  "data": {
    "deleteTestCase": true
  }
}


Fetch linked artifacts of a requirement


Code Block
languagejson
themeEmacs
collapsetrue
{
  getTargetRelationshipEntities(name: REQUIREMENT_ARTIFACT, sourceId: 1074)
}


200


Code Block
languagejson
themeEmacs
collapsetrue
{
  "data": {
    "getTargetRelationshipEntities": [
      839
    ]
  }
}


Fetch artifact externalID using RMsis ID


Code Block
languagejson
themeEmacs
collapsetrue
{
  getArtifactById(id: 839) {
    id
    externalId
  }
}


200


Code Block
languagejson
themeEmacs
collapsetrue
{
  "data": {
    "getArtifactById": {
      "id": 839,
      "externalId": "10023"
    }
  }
}



Known Limitations

This section covers known limitations of current implementation.

...