Hm, That is, just like a lot of Jira stuff, a little tricky too :-)
Every type of field has it's own way of getting the values provided,
some list-type fields need to get a list of values provided, and
string-type custom fields just want the string value in a single-
dimension array: (Some snippets from my C# app)
// string field:
retVal.id = remoteFieldId;
retVal.values = new string[] { fieldvalue };
// Multiple Checkbox/Multiple Select: ('vall' is the list of values
selected, matching the possible fieldvalues exactly!)
retVal.id = remoteFieldId;
if (vall.Count > 0)
{
retVal.values = vall.ToArray();
}
else
{
retVal.values = new string[] { };
}
// Components/Versions: The ID's should be provided as values
string[] comps = new string[component.Count];
for (int v = 0; v < component.Count; v++)
{
comps[v] = component[v].id;
}
retVal.id = remoteFieldId;
retVal.values = comps;
// Priorities/Issuetypes/Resolutions/Groups: (Single-select fields,
only 1 ID should be provided)
retVal.id = remoteFieldId;
retVal.values = new string[] { prioId };
retVal is a single RemoteField that is added to the CustomFields array
for each CustomField.
- Be sure to only add each fieldId once, or replace/append extra
values to the existing CustomField in the array.
- Do not try to add a field that's not available at the Create Issue
screen or you don't have accessrights to.
/Ath