Getting {"customfield_XXXX":"data was not an array"}}. Using C# and Atlassian SDK to create issues

I have the following c# program 

 

var jiraService = Jira.CreateRestClient(
"http://linkhere",
username,
password,
settings);

 

var fieldType = jiraService.Fields.GetCustomFieldsAsync();

var createIssue = jiraService.CreateIssue("OP");

foreach (var i in values)
{
createIssue["Value1"] = i.Values1;
createIssue["Value"] = i.Value;
createIssue["Date1"] = i.Date1.ToString("yyyy-MM-dd");
createIssue["Date2"] = i.Date2.ToString("yyyy-MM-dd");
createIssue["Value2"] = i.Value2;
createIssue["Value4"] = i.Value4;
createIssue["Value5"] = i.Value5;
createIssue["Value6"] = i.Value6;
createIssue.Summary = i.Summary;
createIssue["Value7"] = i.Value7;
createIssue.Type = i.Value8;
createIssue["Value9"] = i.Value9;

}
createIssue.SaveChanges();





class MyClass
{
public string Value{ get; set; }
public string Value1 { get; set; }
public string Value2 { get; set; }
public DateTime Value3 { get; set; }
public DateTime Value4 { get; set; }
public string Value5{ get; set; }
public string Value6{ get; set; }
public string Value7{ get; set; }
public string Value8 { get; set; }
public string Value9{ get; set; }
public string Value10{ get; set; }
public string Value11{ get; set; }
public string Value12 { get; set; }
public string Value13{ get; set; }

public static AuditOfJiraAuditor FromCsv(string csvLine)
{
var values = csvLine.Split(',');
var csvValues = new AuditOfJiraAuditor();

csvValues.Value0= values[0];
csvValues.Value1= values[1];
csvValues.Value2= values[2];
csvValues.Value3= DateTime.Parse(values[3]);
csvValues.Value4= DateTime.Parse(values[4]);
csvValues.Value5 = values[5];
csvValues.Value6= values[6];
csvValues.Value7= values[7];
csvValues.Value8= values[8];
csvValues.Summary= values[9];
csvValues.Value10= values[10];
csvValues.Value11= values[11];
csvValues.Value12= values[12];


return csvValues;
}



I get error on createIssue["Value1"] = i.Values1; saying data was not an array

the filed type is nFeed. Do I need to do something special for that?

 

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,187 views 13 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot