Forums

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

How to get generic workflow id to be applied to create new project via REST

A S March 13, 2020 edited

Hi,

how can I find the id of "original/generic" workflow scheme that I've been newly created? not the one that has been applied to any project. AFAIK, The only way to know the workflowscheme is to retrieve from this api which is the workflow id that has been applied to a project.

GET /rest/api/2/project/{projectKeyOrId}/workflowscheme

I tried to input the id to the POST create new project below in the "workflowSchemeId" :

POST /rest/api/2/project

but get this error,

Could not add project: 400
 msg: {"errorMessages":["Can not construct instance of java.lang.Long from String value 'SCALAR(0x3b54c58)': not a valid Long value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@61b8486f; line: 1, column: 99] (through reference chain: com.atlassian.jira.rest.v2.issue.project.ProjectInputBean[\"workflowSchemeId\"])"]}

 

1 answer

0 votes
Christos Moysiadis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2020 edited

Which Jira version do you have? This rest call is only available for Jira version 8.7.1.

Here exists: https://docs.atlassian.com/software/jira/docs/api/REST/8.7.1/

Here not: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/

 

Edit:

I have tried on Jira verstion 8.5.1 and it does not work. This is why i am asking :)

A S March 13, 2020

I have 8.7.1 in the create project GET.

Christos Moysiadis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2020

well i tried now in Jira 8.8 and its working perfectly.

GET > http://localhost:8080/rest/api/2/project/10400/workflowscheme

result.png

A S March 13, 2020

it works at 8.7.1 as well, can you create a project that inherits properties of your workflow scheme (10400)?

A S March 13, 2020

I've edited the question

Christos Moysiadis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2020

Sorry for the late response! 

I just made the test now. As you can see in the following images , yes i could succesfully create one :)

 

2020-03-13 23_47_29-Postman.png 2020-03-13 23_47_54-Browse projects - JiraTESTTEST.png

A S March 16, 2020

I still get this error, 

Could not add project: 400
 msg: {"errorMessages":["Can not construct instance of java.lang.Long from String value 'SCALAR(0x3b54c58)': not a valid Long value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@61b8486f; line: 1, column: 99] (through reference chain: com.atlassian.jira.rest.v2.issue.project.ProjectInputBean[\"workflowSchemeId\"])"]}

Do you know why?

Suggest an answer

Log in or Sign up to answer