Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I retrieve request-channel-type via Jira API?

Michele Doni
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2021

Hello, I am using REST APIs to retrieve a series of Jira tickets.

I am using a URI structure like this

http://host:port/context/rest/api-name/api-version/resource-name

and I would like to filter my results by request-channel-type, as I do in the web interface through a jql query "request-channel-type=portal".

I have tried the following but it doesn't work (it seems that no filter is applied):

https://host:port/rest/api/2/search?jql=request-channel-type=portal

Does anyone have any suggestion?

 

Thanks,

Michele

ps. I have found how to get the channel type for a single ticket (https://community.atlassian.com/t5/Answers-Developer-Questions/How-can-I-retrieve-request-channel-type-via-Jira-API/qaq-p/546294), but this is not what I need

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 30, 2021

Hi Michele,

I see that you are trying to get back a list of issues from Jira Service Management using the REST API, but you are not getting back the expected results here.

I believe you are calling the correct REST endpoint here to get these issues returned.  I tested this in my own system with the call of :

curl -u admin:password \
-H "Content-Type: application/json" \
"http://localhost:8160/rest/api/2/search?jql=request-channel-type=portal"

And in turn I got back the issues that match this query in a json format. 

 

If you're not getting back any results when you make this query, then I could see a few different possibilities here that could explain why:

  1. Jira Service Management (previously known as Jira Service Desk) is not installed here.
  2. JSM is installed, but has no issues that have been created via the customer portal yet
  3. JSM is installed and has customer portal created issues, but the user making the REST API call is not authenticated or lacks access to view those issues.

I'm included to believe the most likely cause here is that your REST call is not properly authenticated here.  Jira does permit anonymous (unauthenticated) access to the search function, however depending on the permissions of your account will determine what issues Jira will return to you in a search.  Plus this particular field is limited to Jira Service Management projects, so you would need to be using an authenticated user account that has access to view those issues. 

What kind of authentication method are you using for making these REST calls?  We have a few different methods depending on your use case:

I would check that aspect here first and see if that helps.

Let me know.

Andy

Ricardo Martinez
Contributor
July 5, 2023

Hi @Andy Heinzer 

 

I am trying to filter the "request-channel-type = api" but even the issues that I create via api, have the mentioned field as jira.

 

 

Do you need to explicitly set the request-channel-type when creating an issue via api, or why I am not getting the correct results?

Suggest an answer

Log in or Sign up to answer