Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to access API Edited

Hello @Charlie Misonne  Sorry I can't make it clear, what I want to say is that for example, I want to Get all workflow schemes, I go to API [/rest/api/2/workflowscheme ] , but I get 404.A lot of interfaces are like this, is it because I have a lower version of JIRA?My current version is 8.13.0image.png

2 answers

1 accepted

0 votes
Answer accepted

Hi @chuanSun

if the road via API is not working you could probably do a database query (assuming you are indeed using Jira Server - I might not following fully from your above discussion with Charlie but, so assuming you are on Jira Server).

Please note that accessing Jira's database is generally not advisable - it also bears some risk of accidentally deleting data.
Please never try to do a reporting out of database, the REST API should be the way to go.
In this special case however I see chances that you get the desired data from database directly.
Just please be cautious and if possible test queries (like this and also ones in future) on a test system.

A query I used in the past shows projects alongside with the "last updated" information and their project lead but also the Workflow Schemes assigned to each.
I think the information is useful in context (project <-> Workflow Scheme) but in case it is too much information given back you still could adapt the query. However, please test it in advance - whenever possible.

Like said above I would refrain from deeper/further queries against the database and never try to do reporting of any kind.

SELECT p.pkey, p.pname, p.lead, MAX(i.UPDATED) AS "last updated", MAX(i.CREATED) AS "last create", w.name FROM jiraissue i, project p, workflowscheme w, nodeassociation n WHERE i.project = p.id AND p.id = n.source_node_id AND n.sink_node_id = w.id AND n.sink_node_entity = 'WorkflowScheme' GROUP BY p.pkey, p.pname, p.lead, w.name ORDER BY pkey ASC; 

It works on PostgreSQL and on some systems also on MySQL (tested).

Cheers,
Daniel

0 votes
Charlie Misonne Community Leader Jul 08, 2021

Hi @chuanSun, welcome to the Atlassian Community,

I don't really understand your issue.

Are you tryging to get a workflowscheme? In that case you should specify the ID. Or are you trying to create one?

Also: make sure to include the context path in your URL. So if your jira runs on: https://yourdomain.com/jira the full URL is  https://yourdomain.com/jira/rest/api/2/workflowscheme 
If you don't have anything behind the / it should be https://yourdomain.com/rest/api/2/workflowscheme

The documentation about this REST endpoint can be found on https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2/workflowscheme

Charlie Misonne Community Leader Jul 09, 2021

I think you might be confusing the cloud and server documentation. As you mentioned version 8.13.0 I assume you are on a server instance. I adapted the tags of your post.

This is the server documentation for your version: https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2/workflowscheme
And according to that page there is no endpoint to get all workflow schemes. Not sure why though...

Like chuanSun likes this

Thank you for your reply. I was confused. There is no such interface in the server document, is there any other way I can get these data?

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you