Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JSWCLOUD-17305

Agile rest api for epic is not working for Next-gen projects.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • REST API
    • None

      Summary

      Agile rest api for epic is not working for Next-gen projects.

      Steps to Reproduce

      • Create a next gen scrum project
      • Create an epic in the board
      • Call the agile board rest api for epics
      GET https://site.atlassian.net/rest/agile/1.0/board/<BOARD_ID>/epic
      
      {"maxResults":50,"startAt":0,"isLast":true,"values":[{"id":11472,"key":"SCRUM-19","self":"https://site.atlassian.net/rest/agile/1.0/epic/11472","name":"","summary":"epic","color":{"key":"color_1"},"done":false}]}
      
      • Call the self URL of the epic
      GET https://site.atlassian.net/rest/agile/1.0/epic/11472
      

      Expected Results

      The epic details should be returned

      Actual Results

      The call fails with a 404 and permission error message.

      Request URL: https://try-ramon-appswitcher.atlassian.net/rest/agile/1.0/epic/11472
      Request Method: GET
      Status Code: 404 
      
      {"errorMessages":["The requested epic cannot be viewed because it either does not exist or you do not have permission to view it."],"errors":{}}
      

            [JSWCLOUD-17305] Agile rest api for epic is not working for Next-gen projects.

            Thanks goes to the team rhys5690, so i will be sure to pass it on. My apology that you didn't get it sooner, thanks for the kind words.

            Nathan Sturgess (Inactive) added a comment - Thanks goes to the team rhys5690 , so i will be sure to pass it on. My apology that you didn't get it sooner, thanks for the kind words.

            Thanks Nathan,

            I noticed this was now working a couple of days ago.

            This has unblocked an important feature for my app.

            Great work. Much appreciated.

            Best Regards,

            Rhys

            Rhys Diab {Agile Docs} added a comment - Thanks Nathan, I noticed this was now working a couple of days ago. This has unblocked an important feature for my app. Great work. Much appreciated. Best Regards, Rhys

            Hi everyone,

            Thanks for commenting and voting on this ticket.

            As part of the next-gen project, we had the opportunity to re-think how epics worked and aligned the functionality with the Jira platform APIs.

            Please use the Issue type hierarchy API to see which issues are Epics in a next-gen project.

            Instead of the Agile REST APIs, in next-gen please use these alternatives:

            Get issues without epic - Search for issues that don't belong to an epic by using the Search for issues using JQL operation in the Jira platform REST API. Build your JQL query using the parent is empty clause. For more information on the parent JQL field, see Advanced searching.

            Get issues for epic - Search for issues that belong to an epic by using the Search for issues using JQL operation in the Jira platform REST API. Build your JQL query using the parent clause. For more information on the parent JQL field, see Advanced searching.

            Move issues to epic - Edit the issue and set the parent field. Example:

            {"fields":{"parent":{"id":"11111"}}}
            

            Remove issues from epic - Edit the issue and set the parent field to be empty. Example: {"fields":{"parent":{}}}

            {"fields":{"parent":{}}}
            

            Create an issue in the epic by setting the parent field when calling the Create issue endpoint. Example:

            {"fields":{"project":{"id":"11111"},"issuetype":{"id":"11111"},"summary":"aaaaa","parent":{"id":"11111"}}}
            

            Regards,
            Nathan Sturgess
            nsturgess@atlassian.com
            Product Manager, JIRA Platform

            Nathan Sturgess (Inactive) added a comment - Hi everyone, Thanks for commenting and voting on this ticket. As part of the next-gen project, we had the opportunity to re-think how epics worked and aligned the functionality with the Jira platform APIs. Please use the Issue type hierarchy API to see which issues are Epics in a next-gen project. Instead of the Agile REST APIs, in next-gen please use these alternatives: Get issues without epic - Search for issues that don't belong to an epic by using the Search for issues using JQL operation in the Jira platform REST API. Build your JQL query using the parent is empty clause. For more information on the parent JQL field, see Advanced searching. Get issues for epic - Search for issues that belong to an epic by using the Search for issues using JQL operation in the Jira platform REST API. Build your JQL query using the parent clause. For more information on the parent JQL field, see Advanced searching. Move issues to epic - Edit the issue and set the parent field. Example: { "fields" :{ "parent" :{ "id" : "11111" }}} Remove issues from epic - Edit the issue and set the parent field to be empty. Example: {"fields":{"parent":{}}} { "fields" :{ "parent" :{}}} Create an issue in the epic by setting the parent field when calling the Create issue endpoint. Example: { "fields" :{ "project" :{ "id" : "11111" }, "issuetype" :{ "id" : "11111" }, "summary" : "aaaaa" , "parent" :{ "id" : "11111" }}} Regards, Nathan Sturgess nsturgess@atlassian.com Product Manager, JIRA Platform

            Is there an update from Jira eng here?  Shipping broken API's is terrible practice.  

            Matthew Darrow added a comment - Is there an update from Jira eng here?  Shipping broken API's is terrible practice.  

            This is a really important bug to fix. It is critical to my add on.

            Rhys Diab {Agile Docs} added a comment - This is a really important bug to fix. It is critical to my add on.

            It's really painful for companies like us who have built integrations to Jira which customers cannot use as Jira does not support a working API for their latest features.  This should not be low priority for any PM team with experience.  Shipping API's that do not work is unacceptable.  

            Matthew Darrow added a comment - It's really painful for companies like us who have built integrations to Jira which customers cannot use as Jira does not support a working API for their latest features.  This should not be low priority for any PM team with experience.  Shipping API's that do not work is unacceptable.  

            Thanks KC. That's a creative workaround, I'll give it a shot! It's still unfortunate that we have to resort to something like this to get such a key piece of issue metadata, though  Any updates from the API team on when this will be supported officially?

            Cedric Hurst added a comment - Thanks KC. That's a creative workaround, I'll give it a shot! It's still unfortunate that we have to resort to something like this to get such a key piece of issue metadata, though  Any updates from the API team on when this will be supported officially?

            kckern added a comment - - edited

            OK, well, I don't have time to wait around for an official fix, so here is a quick and dirty ugly workaround:

            You'll need:

            • The numeric project id
            • The epic ID (not the key)
            • A list of the issue IDs you want to add to the epic (again ids, not keys)
            • Your cloud.session.token cookie
              • You'll need to fish this out of your browser after logging in to the Jira UI.
              • Developer Tools > Application > Cookies> cloud.session.token cookie

            Integrate this curl command into your script or workflow, swapping in your values into the placeholder braces:

            curl 'https://{domain}.atlassian.net/rest/internal/simplified/1.0/projects/{1000}/issues/{2000}/children' -H 'content-type: application/json' -H 'cookie: cloud.session.token={TOKEN}' --data-binary '{"issueIds":["3000"]}' --compressed 
            

            And there you have it!


            Also in python, if that helps:

            import requests
            import json
            def addToEpic(domain, projectId, epicId, issueIds, token):   
                headers = {
                    'content-type': 'application/json',
                    'cookie': 'cloud.session.token='+token,
                }
                url = 'https://'+domain+'.atlassian.net/rest/internal/simplified/1.0/projects/'+str(projectId)+'/issues/'+str(epicId)+'/children'
                data = '{"issueIds":'+json.dumps(issueIds)+'}'
                response = requests.post(url, headers=headers, data=data)
                return response
            

            Don't expect that token to last very long.  This obviously is not a production-grade reliable solution.  But it will work for running a batch process to get issues added to epics in bulk.

             

            kckern added a comment - - edited OK, well, I don't have time to wait around for an official fix, so here is a quick and dirty ugly workaround: You'll need: The numeric project id The epic ID (not the key) A list of the issue IDs you want to add to the epic (again ids, not keys) Your cloud.session.token cookie You'll need to fish this out of your browser after logging in to the Jira UI. Developer Tools > Application > Cookies> cloud.session.token cookie Integrate this curl command into your script or workflow, swapping in your values into the placeholder braces: curl 'https://{domain}.atlassian.net/rest/internal/simplified/1.0/projects/{1000}/issues/{2000}/children' -H 'content-type: application/json' -H 'cookie: cloud.session.token={TOKEN}' --data-binary '{ "issueIds" :[ "3000" ]}' --compressed  And there you have it! Also in python, if that helps: import requests import json def addToEpic(domain, projectId, epicId, issueIds, token): headers = { 'content- type ' : 'application/json' , 'cookie' : 'cloud.session.token=' +token, } url = 'https://' +domain+ '.atlassian.net/rest/internal/simplified/1.0/projects/' + str (projectId)+ '/issues/' + str (epicId)+ '/children' data = '{ "issueIds" :' +json.dumps(issueIds)+ '}' response = requests.post(url, headers=headers, data=data) return response Don't expect that token to last very long.  This obviously is not a production-grade reliable solution.  But it will work for running a batch process to get issues added to epics in bulk.  

            kckern added a comment -

            Major impact to progress over here too.  Hoping you can increase the priority and assign it to someone!

            kckern added a comment - Major impact to progress over here too.  Hoping you can increase the priority and assign it to someone!

            Pak Yu added a comment -

            I agree. It is important to have a functional api to perform basic tasks.

            Pak Yu added a comment - I agree. It is important to have a functional api to perform basic tasks.

              Unassigned Unassigned
              rmacalinao Ramon M
              Affected customers:
              18 This affects my team
              Watchers:
              27 Start watching this issue

                Created:
                Updated:
                Resolved: