Forums

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

Unable to add story points with Python API

Bittu Bhowmick (US) April 19, 2022

Hello Folks,

I am using a Python API to do some automation in JIRA Cloud Instance. Now, where I am stuck is I am unable to add story points to a particular story. Below is my code snippet:

from jira import JIRA
user = '************'
apikey = '*******************'
server = 'https://*****.***.com/jira/'

# Creating connection with the JIRA
jira_server = {'server': server, 'verify': False}
jira = JIRA(options=jira_server, basic_auth=(user, apikey))

issue_dict = {
'project': {'key': 'CC'},
'issuetype': {'name': 'Story'},
'summary': "This is a test user story",
'customfield_10204': <sprint_id>
}
jira.create_issue(fields=issue_dict)

The issue created is CC-12093 with id 705378

Now, I need to assign story point to this particular user-story
issue = jira.issue("CC-12093")
issue.update(
fields={"custom_field_10208":8})

But I am getting the below error:
response text = {"errorMessages":[],"errors":{"custom_field_10208":"Field 'custom_field_10208' cannot be set.
It is not on the appropriate screen, or unknown."}}

1 answer

0 votes
Robert Wen_Cprime_
Community Champion
April 19, 2022

Hello, @Bittu Bhowmick (US) !  Welcome to the Atlassian Community!

 

I have a couple of guesses, based on what you've shown.

The first thing you should probably check is whether the Story Points field is available on the Edit action for an issue (Edit screen has Story Points field or default screen has Story Points field).

The second thing you should probably check is what sort of input is the Story Points field?  Is it a number? Or is it a dropdown?

Hope this helps

Bittu Bhowmick (US) April 21, 2022

Hi @Robert Wen_Cprime_ 

Thanks for the reply. I would like to inform you that the story point is in edit action for an issue and it is of type number.

Bittu Bhowmick (US) April 28, 2022

@Robert Wen_Cprime_ Have you found any answer to my query?

Robert Wen_Cprime_
Community Champion
April 28, 2022

Those were the "obvious suspects".  I have no other ideas, sorry.

Bittu Bhowmick (US) April 28, 2022

So my question now would be how do I make my code work to add the story points for user story and estimated time for sub-task?

Robert Wen_Cprime_
Community Champion
April 28, 2022

Have you asked your question in the Atlassian Developer community forums?  That's a little more specialized and may give you the answers you seek.  This community is more general purpose.

https://community.developer.atlassian.com

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events