Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Atlassian.Jira Sdk --> can not set Sprint Value in CustomFields

Hello,

I would like to create a new issue via the Atlassian.Jira SDK and assign it a sprint.

To do this, I add a CustomField to the previously created issue, but when I save the issue I get the following error message:

{"errorMessages":["Number value expected as the Sprint id."],"errors":{}}

 

var story = Global.GlobalSettings.JiraInstance.CreateIssue("CGMDETM");
story.Type = "User Story";
story.Priority = "Major";
story.Summary = "Agile Meetings";
//story.Reporter = Global.GlobalSettings.UserName;
story.FixVersions.Add("19/1");
story.DueDate = DateTime.Now;
story.Assignee = "jens.debernitz@cgm.com";
story.Description = "Hallo das ist eine User Story"; story.CustomFields.Add("Epic Link", TextFieldEpicAgileMeetings.Text);
story.CustomFields.Add("Cost Unit", "Product Investments"); story.CustomFields.Add("CGM Product", "DE65 TURBOMED");
//story.CustomFields.Add("Sprint", @"2/19-1-Turbo.Plopp");
story.CustomFields.Add("Internal Number", "/");
story.CustomFields.Add("DPA relevant", "Irrelevant");
story.CustomFields.Add("Acceptance Criteria", "de.communardo.jira.plugins.acceptance.criteria.beans.AcceptanceCriteria@725d9f55");
story.CustomFields.Add("Business Value", "1");
story.CustomFields.Add("Requirement Type", "Non functional");
story.CustomFields.Add("Sprint", "2/19-2-Turbo.Plopp"); try
{
story.SaveChanges();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}

2 answers

2 accepted

1 vote
Answer accepted

The number it wants is the id of the sprint in the database, not the "name" (as those can be non-unique and variable).  You need to either look that up manually, or issue REST calls to find out what it is.  See https://docs.atlassian.com/jira-software/REST/7.3.1/

0 votes
Answer accepted

Oh Yes I have see it,

 

An another Question:

I will make a Query of my Issus to become all Sprints

What must I do?

var issues = (from i in Global.GlobalSettings.JiraInstance.Issues.Queryable
where i.Project == "CGMDETM" && "Sprint" //&& (from u in i.FixVersions where u.Name == "19/1" select u).ToString() == "19/1"
select i);

I do not understand "issues to become all sprints"?  I understand you've got a query to find issues that you want to do something with, but I'm not sure of the rest of the question

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

103 views 0 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you