Uploaded image for project: 'Jira Align'
  1. Jira Align
  2. JIRAALIGN-4156

Post Calls to Epics Endpoint Throws an Error If The Owner Field is Set as Required in JA

XMLWordPrintable

    • 2
    • Severity 2 - Major
    • No

      Issue Summary

      The customer is facing an issue whereby the POST calls to the Epics endpoint /align/api/2/Epics throws an error if the Owner field is set as required in JA Details Panels Settings. The same does not occur if the Epics are created via JA UI.

      Steps to Reproduce

      1. In JA go to Administration > Settings > Details Panels Settings
      2. Select a Portfolio and work item e.g Epic
      3. Set the Owner toggle on
      4. Click the Save button
      5. Navigate to the Epics grid
      6. Create a new Epic via the JA UI
      7. Try to create a new Epic via API call
        1. Access the swagger page https://alignsupport.jiraalign.com/rest/align/api/docs/index.html
        2. Filter by Epics
        3. Run a GET call against endpoint /align/api/2/Epics/{id}
        4. Copy the entire response body
        5. Run a POST call against /align/api/2/Epics using the content copied in step 4.

      Expected Results

      • The Epic is successfully created via JA UI and via API call using the POST method to the Epics endpoint /align/api/2/Epics.

      Actual Results

      The Epic is successfully created via JA UI, the ownerId  is required as evidenced below.

      JA Instance: https://alignsupport.jiraalign.com/EpicGrid?FirstTime=True&Programs=399&FilterID=412&EpicID=2996

       

      Below the API request body used as the attempt to create the Epic via API POST method, note the ownerId field is part of it and set as required in the JA UI.

       

      {
        
        "title": "Edvaldo Test Epic - PS-96709v11",
        "createDate": "2022-05-18T11:41:18Z",
        "ownerId": "661789",
        "themeId": 276,
        "strategicDriver": null,
        "description": "Test to create epic in JA VIA  API using POST method owner field (required) in the Details pAnels settings.",
        "primaryProgramId": 399,
        "tags": null,
        "state": 1,
        "processStepId": null,
        "acceptedDate": null,
        "acceptedUserId": null,
        "strategicValueScore": 1,
        "type": 1,
        "fcastShare": null,
        "reportColor": "#069de2",
        "mvp": 0,
        "investmentType": null,
        "notStartedBy": "661789",
        "notStartedDate": "2022-05-18T11:41:18Z",
        "notStartedDateEnd": null,
        "inProgressBy": null,
        "inProgressDate": null,
        "inProgressDateEnd": null,
        "isRecycled": null,
        "lastUpdatedDate": "2022-05-18T11:41:18Z",
        "lastUpdatedBy": "661789",
        "createdBy": "661789",
        "targetCompletionDate": null,
        "startInitiationDate": null,
        "portfolioAskDate": null,
        "externalOpEx": null,
        "externalCapEx": null,
        "totalCapEx": null,
        "totalOpEx": null,
        "budget": null,
        "discountRate": null,
        "initialInvestment": null,
        "forecastYears": null,
        "yearlyCashFlow1": null,
        "planningMode": null,
        "businessImpact": null,
        "riskAppetite": null,
        "itRisk": null,
        "failureImpact": null,
        "failureProbability": null,
        "customerIds": null,
        "epicObjectId": 2,
        "capitalized": null,
        "efficiencyDividend": null,
        "revenueAssurance": null,
        "roi": null,
        "effortSwag": 1,
        "abilityToExec": null,
        "hypothesis": null,
        "designStage": null,
        "prototype": null,
        "leanUxCanvas": null,
        "workCodeId": null,
        "releaseIds": [],
        "additionalProgramIds": [],
        "additionalProcessStepIds": [],
        "points": [
          {
            "estimationSystem": "T-Shirt",
            "estimationValue": null
          }
        ],
        "externalKey": null,
        "externalId": null,
        "externalProject": null,
        "connectorId": null,
        "fundingStage": null,
        "quadrant": null,
        "strategicHorizon": null,
        "spendToDate": null,
        "estimateAtCompletion": null,
        "isSplit": null,
        "parentSplitId": null,
        "isCanceled": null,
        "customFields": [
          {
            "customfield_70001": null
          },
          {
            "customfield_70002": null
          },
          {
            "customfield_70003": null
          },
          {
            "customfield_70004": null
          },
          {
            "customfield_70005": null
          }
        ]
      }
      
      

       

      The POST API call to the Epics endpoint /align/api/2/Epics fails and the below exception is thrown in the Splunk log:

      { [-]
         Level: Error
         MessageTemplate: User: {User}, Authentication type: {AuthenticationType}, Method: {Method}, Message: {Message}, QueryString: {QueryString}
         Properties: { [-]
           ActionId: 5b31659d-fba7-4ae5-a35f-0c337621c248
           ActionName: AgileCraft.Api.Controllers.EpicsController.Post (AgileCraft.Api)
           AuthenticationType: USERIDTOKEN
           Build: 10.107.3.18418
           Message: Cannot create epic. Object reference not set to an instance of an object.
           Method: POST
           ParentId:
           Product: AgileCraft.Api
           QueryString:
           RequestId: 8000339f-0001-e200-b63f-84710c7967bb
           RequestPath: /rest/align/api/2/Epics
           SourceContext: AgileCraft.Api.Controllers.EpicsController
           SpanId: |901e88c2-4177c0ffa59bd183.
           TraceId: 901e88c2-4177c0ffa59bd183
           User: 661789
         }
         RenderedMessage: User: "661789", Authentication type: USERIDTOKEN, Method: "POST", Message: "Cannot create epic. Object reference not set to an instance of an object.", QueryString: ""
         Timestamp: 2022-05-18T13:02:55.7321167-04:00
      }
      

      Workaround

      1. In JA go to Administration > Settings > Details Panels Settings
      2. Select a Portfolio  and work item e.g Epic or Feature(Jira Epics)
      3. Set the Owner field as optional
      4. Click the Save button

              kforeman@atlassian.com Kyle Foreman
              55bc69081443 Edvaldo Lima
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: