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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

246 views 1 18
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