I want to change the status from closed to open. I think this should be called transition.
How can I add a transition? I am getting confused about the actual Jira workflow.
I only want to be able to open a request if it has been closed using REST.
GET /rest/api/2/issue/:issueIdOrKey/transitions?expand=transitions.fields
POST /rest/api/2/issue/JC-11/transitions?expand=transitions.fields
BODY:
{ "update": { "comment": [ { "add": { "body": "Comment added when resolving issue" } } ] }, "transition": { "id": "5" } }
To change the transition
Sorry, I have a mental fog right now.
i've seen this post on a discussion
to change status from Resolved to Closed it uses transition: id=701. I believe that it's very inflexible because Salesforce has api call limits and I wanted to avoid GET request before POST request. But now I see that it's impossible. I must at first perform GET request and when POST request.
Ciao @Paolo Di Bello ,
Can you kindly provide more details on what you are trying to achieve since I am not sure I have a correct understanding of it?
However, please notice that in your post you are referring to the Jira Core REST API endpoint to transition issues, while there is also a Jira Service Desk REST API endpoint to do the same:
POST /rest/servicedeskapi/request/{issueIdOrKey}/transition
Please find below the links to the Jira Service Desk REST API documentation for Cloud and Server:
Then:
Kindly provide more details on what you are trying to achieve so that we can further help.
Cheers,
Dario
I think this might be the answer I needed. That's what I wanted to achieve. I'll get back to you tomorrow as I test it and I'll let you know.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @PaoloDiBello,
I have just realized I have pasted the wrong link in my previous post that was still pointing to the endpoint to transition Jira Core Cloud issues.
I have now fixed it by adding the correct link (below):
Please review both documentation pages and see which one fits best your needs.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B
Fine, I can get transitions for a certain workflow but not the one I am using (classic). So the only way I can get transitions is by using this endpoint:
/rest/api/2/issue/:issueIdOrKey/transitions
I had a project and before switching the workflow and migrating every issue to the classic workflow I could use the endpoint you suggested me but now that I migrated the workflow I cannot see a single transition by using
/rest/servicedeskapi/request/${issueIdOrKey}/transition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Paolo Di Bello ,
Generally speaking: the Jira Core endpoint will work in any case (Jira Core, Software and Service Desk issues), while the Jira Service Desk endpoint will only work if:
Now, I am not sure if you moved the issues or you just switched workflow or anything else, however, can you check if maybe the issues for which you cannot get transitions using the JSD endpoint are not matching one of the 2 conditions above?
Ciao,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it's matching both conditions.
I deleted all the issues and made sure the new one had the type as you said.
I tried making a rest API call to see all the available service desks and the one I am using is in there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a way to check if the only issue I have has the correct type?
Aren't requests the same as issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Paolo Di Bello ,
In short:
Issues are how pieces of work are internally represented Jira.
For further details on this topic, please review the below documentation:
Please let me know if this explain.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I understood the difference and can now tell them apart.
You told me my issue must respect these parameters in order to be showed
using this REST API:
/rest/servicedeskapi/request/:issueIdOrKey/transition
I get the following response with a status of 200.
{
"size": 0,
"start": 0,
"limit": 50,
"isLastPage": true,
"_links": {
"self": "https://XXX.atlassian.net/rest/servicedeskapi/request/XXX-9/transition",
"base": "https://XXX.atlassian.net",
"context": ""
},
"values": []
}
What I want to be able to do is fix it to make it work with a project.
I feel like I am messing things up because I am trying to move things here and there changing settings to no avail.
What are the steps I should follow to check that I have correct request types?
Maybe by doing, this should return that and this should that and if it doesn't that I have a problem with that and I should fix it.
The request type for the only request I have
I only kept one request type for each issue type and deleted all the groups.
These are my issue types instead:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dario B ,
this is transition work flow as we fallow in my JSM.
"I'm using the Service Desk APIs to change the status of an issue or ticket via the Transition REST API. The API token I'm using belongs to an administrator, and they are able to change the status in the web interface. However, when I use the following URL: https://org.atlassian.net/rest/servicedeskapi/request/{issueIdOrKey}/transition
, I encounter the following issue."
please help me on this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Paolo Di Bello ,
From one of the above comments you have posted, I happen to understand that you migrated a JSD project from Next-Gen to Classic. Is this correct?
If this is correct, then I would suggest to just create a new Classic JSD project and start from scratch. Next-Gen projects are still under development and there are a number of things that don't work the same way as Classic projects yet.
Also, as mentioned in:
Jira Service Desk Cloud introduced next-gen projects in Feb 2019 and developers may experience some differences when calling either the Jira Service Desk Cloud REST API or Jira platform REST API.
App developers and REST API consumers may need to make modifications to support next-gen projects.
Please create a new Classic JSD project and test if both endpoints are working in there as well as if you are able to make the issue transition using REST API calls. In case this still won't please provide as many details as possible about what has been done and what failed.
Ciao,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This thread is getting a little long.
What template type should I use?
How do I tell a project is next-gen or not?
I can't seem to find any info related to the that when selecting a template
I want a classic workflow.
In the previous project, I used the Internal service desk template. Once again I could see all the transitions using the rest api but when I switched to classic workflow I couldn't see anything if used the service desk REST API.
Open, Close, Reopen and Resolve I think.
These are the only transactions I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Paolo Di Bello ,
This thread is indeed getting too long so let me try to address one question at the time.
Also, sorry for the confusion caused, you are already using a Classic project. I was mislead while reading that you switched to classic workflow, while 'classic' is actually the name of the workflow scheme you have associated to your Service Desk project (it is now clear from the above screenshot).
Now, in order to answer your questions:
How do I know if it is Classic or Next-Gen project:
When creating a project you choose between Classic or Next-Gen as the first thing
However, if you used the "Internal Service Desk" template then you are already using a Classic Service Desk project since there is only one template available for Next-Gen Service Desk so far. For details see: Create edit and delete Next-Gen service desk projects
How do I know if a request type is set?
If you create the issue in Jira rather than from the customer portal, you may end up having a valid Jira issue but an invalid Service Desk request, since the request type is missing.
Missing request type:
Setting request type when missing:
How do I get the transition ids?
Easiest way is to edit the workflow associated to the project. I did exactly the same you did, I created a JSD project using the internal template and I configured it to use the classic workflow scheme.
Then, go to project setting and edit the workflow (text mode), you will see the transition ids:
------
About the REST API part, I have followed your steps (create internal SD project and change workflow scheme to classic) and I am able reproduce the reported behavior. I need to further look into this since it may be a bug or a change of behavior (or we are missing something).
In the meanwhile, you can use the Jira Core REST API endpoint to get the transition ids, since that one is working fine and it applies to every kind of Jira issue, not only the Service Desk requests:
https://xxxx.atlassian.net/rest/api/2/issue/ISSUE-KEY/transitions
I hope this clarifies.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.