Jira Align API for Story creation
Asked by HanumaSiva Chikkam:

Hello Community,

I was using Jira Align API's for story creation which was working fine until yesterday and today I am seeing a weird error when doing the same. Below is the error I am receiving while creating the Story via API.

Any leads are appreciated.

**Cannot create story. Following properties: 'owner' are required.**

URL - I am using

**<https://xxxx.jiraalign.com/rest/align/api/2/Stories>**

{  
"title": "Delete-Define requirements for each hold type and its process flow (OBO/PBO) 1",  
"description": "As a BA I want/need to so that I can ",  
"state": 0,  
"type": 1,  
"mmf": 0,  
"automation": null,  
"programId": 5,  
"ownerId": "68",  
"featureId": 4423,  
"releaseId": 27,  
"releaseVehicleIds": null,  
"teamId": 81,  
"iterationId": null,  
"valuePoints": 1,  
"effortPoints": 1,  
"tags": "TEST",  
"assumption": "string",  
"personaId": null,  
"developmentalStepId": null,  
"operationalStepId": null,  
"isAccepted": 0,  
"splitType": 0,  
"splitReason": "string",  
"externalProject": null,  
"jiraProjectKey": null  
}


Answers:
author: Mark Cruth
body: Hi [@HanumaSiva Chikkam](/t5/user/viewprofilepage/user-id/4919526) ! Thanks for reaching out! I tried your json and it appears to work for me (after changing some of the numbers to match my own instance). Did you try changing the Owner ID value to something else (another valid user)? Curious if it has to do with the user record. Let me know if you can create a story by changing some of the variables.

comments: author: HanumaSiva Chikkam
body: Hi, I tried with different user id's and still the same error.


author: Mark Cruth
body: Another troubleshooting trick is to strip out all the non-required fields from the json to see if you can create the story. Check whatever field are required and only include those in the payload...see if that works.


author: HanumaSiva Chikkam
body: No luck, same error :(


author: Mark Cruth
body: I was just able to recreate the error by making the "Assignee" field on a story required. Can you check the details panels settings for the portfolio to see if assignee is required? If it is, trying removing the requirement to see if you can create the story.

Additionally, I see you've set a team in the json...are the individuals you are assigning to the story part of that team? Check that too.


author: HanumaSiva Chikkam
body: The assignee field is mandatory as per company config. This issue is not seen when creating manually and then trying to GET that story via API, I can see the JSON fine and I compared it with the POST as well I don't see any variation in the data sent in JSON for creation but its giving the error.

JSON - GET payload  
\[  
{  
"id": 26189,  
"title": "TEST",  
"description": "TEST Desc",  
"state": 0,  
"type": 1,  
"mmf": 0,  
"automation": null,  
"programId": 5,  
"ownerId": "218",  
"featureId": 4657,  
"releaseId": 27,  
"releaseVehicleIds": \[\],  
"teamId": 79,  
"iterationId": null,  
"valuePoints": 1,  
"effortPoints": 1,  
"tags": null,  
"assumption": null,  
"personaId": null,  
"processStepId": null,  
"createdBy": "443",  
"createDate": "2022-05-10T08:39:19Z",  
"lastUpdatedDate": "2022-05-10T08:49:19Z",  
"lastUpdatedBy": "443",  
"isRecycled": null,  
"acceptedDate": null,  
"isAccepted": null,  
"acceptedBy": null,  
"parentSplitId": null,  
"splitType": null,  
"splitReason": null,  
"isParentSplit": null,  
"isCanceled": null,  
"externalProject": null,  
"externalId": null,  
"externalKey": null,  
"jiraProjectKey": null,  
"connectorId": null,  
"itemToSyncDate": "2022-05-10T08:49:19Z",  
"customFields": null,  
"links": \[\],  
"self": "<https://company.jiraalign.com/rest/align/api/2/stories/26189>"  
}  
\]


author: Mark Cruth
body: [@HanumaSiva Chikkam](/t5/user/viewprofilepage/user-id/4919526) so you were able to manually create the same story via the UI, but the same data wouldn't pass through the API POST command with all the attributes of the story being the same (specifically the Assignee / OwnerID)?


author: HanumaSiva Chikkam
body: True


author: Mark Cruth
body: At this point I think you'll need to get Atlassian Support involved. Submit a ticket here: <https://support.atlassian.com/contact/#/>

Hopefully support can dig in a little deeper to see what might be up with your instance :)


author: HanumaSiva Chikkam
body: Sure, thanks for looking into it. I will work with support.


author: HanumaSiva Chikkam
body: Hi [@Mark Cruth](/t5/user/viewprofilepage/user-id/3648064) any inputs are highly appreciated.


Tags: api