# Where to request / suggest additional REST API's for JSM Cloud

**URL:** <https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547>\
**Category:** JSM Development\
**Tags:** feature-request, rest-api, jira-service-management\
**Created:** [September 4, 2023, 3:25am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547 "2023-09-04T03:25:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.white](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/richard.white/32/38845_2.png) [@richard.white](https://community.developer.atlassian.com/u/richard.white)\
**Post date:** [September 4, 2023, 3:25am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/1 "2023-09-04T03:25:28Z")

</div>

Hi,

We developed a custom Connect app for a customer that used an undocumented API to retrieve the Page Name for a given page ID in a JSM knowledge base in order to render a list for a report.

It recently stopped working, and we are investigating whether it is possible to release this app publicly.

Essentially the “get Articles” [https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-knowledgebase/#api-rest-servicedeskapi-knowledgebase-article-get](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-knowledgebase/#api-rest-servicedeskapi-knowledgebase-article-get) resource only has a free text search field, and since the only information our app has about knowledge base pages is the page ID - we have no way to reliably retrieve this page name.

What would be ideal would be an extra parameter to the search that allows specifying a list of page id’s, and being able to get the summary information for each page - alternatively a get page by ID API.

The bigger problem is that we have no way to suggest or request this change - is there any way for this feedback to be passed to the relevant team? In general - what should we do with such requests?

---

<div class="post-metadata">

**Author:** ![aagrawal2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/aagrawal2/32/40775_2.png) [@aagrawal2](https://community.developer.atlassian.com/u/aagrawal2)\
**Post date:** [September 4, 2023, 8:46am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/2 "2023-09-04T08:46:01Z")

</div>

@richard.white

Although, ‘get articles’ API is an experimental API, I will have to check with our team if it’s ok to release the app publicly using it.

As for how to retrieve the page name using page ID, for now, there is no straightforward way to go about it. But I have found a workaround and see if it works for you:

`https://{your-domain}.atlassian.net/rest/servicedeskapi/knowledgebase/article?query=project={project-key}`

Try making the GET request to above API along with correct auth and `'X-ExperimentalApi: opt-in'` header.

You will get a list of knowledge base articles and you can filter through them with a bit of code. Here is an example:

```auto
function findTitleById(jsonData, idToSearch) {
  // Loop through the 'values' array
  for (let i = 0; i < jsonData.values.length; i++) {
    // Check if the 'pageId' matches the given ID
    if (jsonData.values[i].source.pageId === idToSearch.toString()) {
      // Return the 'title' if a match is found
      return jsonData.values[i].title;
    }
  }
  // Return null if no match is found
  return null;
}

// Sample JSON data
const jsonData = {
  "size": 2,
  "start": 0,
  "limit": 50,
  "isLastPage": true,
  "_links": {
    "self": "https://your-domain.atlassian.net/rest/servicedeskapi/knowledgebase/article?query=project=AS",
    "base": "https://your-domain.atlassian.net",
    "context": ""
  },
  "values": [
    {
      "title": "ASSETS",
      "excerpt": "Welcome to your new knowledge base space!\nWe've ad",
      "source": {
        "type": "confluence",
        "pageId": "1413972162",
        "spaceKey": "AS"
      },
      "content": {
        "iframeSrc": "https://your-domain.atlassian.net/rest/servicedeskapi/knowledgebase/article/view/1413972162"
      }
    }
  ]
};

// Test the function
const idToSearch = 1413972162;
const title = findTitleById(jsonData, idToSearch);

if (title) {
  console.log(`Title found: ${title}`);
} else {
  console.log('No matching ID found');
}

```

Let me know if that helps.

---

<div class="post-metadata">

**Author:** ![richard.white](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/richard.white/32/38845_2.png) [@richard.white](https://community.developer.atlassian.com/u/richard.white)\
**Post date:** [September 4, 2023, 9:02am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/3 "2023-09-04T09:02:19Z")

</div>

Hi @aagrawal2 ,

Thanks so much for the quick reply - that will help a bit - but obviously not ideal - I think we will have to consider the case where there might be several hundred pages in the knowledgebase - and perhaps cache the results or something.

Your query format `query=project={project-key}` does not seem to be documented anywhere - is there any more information or other information about it?

---

<div class="post-metadata">

**Author:** ![aagrawal2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/aagrawal2/32/40775_2.png) [@aagrawal2](https://community.developer.atlassian.com/u/aagrawal2)\
**Post date:** [September 5, 2023, 12:14am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/4 "2023-09-05T00:14:40Z")

</div>

In this case, I tried it from the top of my mind. This is the same behaviour as of J[ira context parameters](https://developer.atlassian.com/cloud/jira/platform/context-parameters/#conditions-in-query-parameters).

In the page, it says:

> The context variable must be either a path component or the `value` in a query string parameter formatted as `name=value`.

---

<div class="post-metadata">

**Author:** ![richard.white](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/richard.white/32/38845_2.png) [@richard.white](https://community.developer.atlassian.com/u/richard.white)\
**Post date:** [September 5, 2023, 3:06am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/5 "2023-09-05T03:06:08Z")

</div>

Hi @aagrawal2

It does seem to work - however - is it possible you could request the team to document this behaviour. It is really not intuitive that searching linked Confluence pages works by specifying Jira context parameters in the free text query field and it is not mentioned on the rest api documentation.

---

<div class="post-metadata">

**Author:** ![aagrawal2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/aagrawal2/32/40775_2.png) [@aagrawal2](https://community.developer.atlassian.com/u/aagrawal2)\
**Post date:** [September 5, 2023, 6:30am UTC](https://community.developer.atlassian.com/t/where-to-request-suggest-additional-rest-apis-for-jsm-cloud/72547/6 "2023-09-05T06:30:27Z")

</div>

Agreed. I will pass this on to the team. Thanks.
