jira-client
jira-client copied to clipboard
setCustomFieldValues example?
What is the syntax for passing multiple custom field values when creating an issue? Here's what I believed it to be:
$issue = new RemoteIssue();
$issue
->setProject('PROJECT')
->setType(10)
->setSummary('Testing (created via the API)')
->setCustomFieldValues([
'customfield_12311' => 'Foo'
])
->setDescription('This is a test issue (created throug the API)');
But I get an Internal Server Error each time when attempting to create the issue.
I also
$issue = new RemoteIssue();
$company_name = new RemoteCustomFieldValue();
$company_name
->setCustomfieldId('customfield_12311')
->setValues('Acme Company');
$fields[] = $company_name;
$issue
->setProject('PROJECT')
->setType(10)
->setSummary('Testing (created via the API)')
->setCustomFieldValues($fields)
->setDescription('This is a test issue (created throug the API)');
But still no go.
May be a dumb question but: have you tried setValues(['Acme Company'])
? Worked for me.