Jira Command Line Interface does not create issues with custom field even though the user is a project administrator

VijaykarthikaG May 9, 2012

Through the Jira CLI 2.3.0 version I am trying to create an issue as jira -
a createIssue --project "ADQA" --type "QA Task" --fixVersions "SPP-700" --custom
"Milestones:M01" --components "Feature Testing" --verbose --debug --summary "In
Test"

Milestones is a custom field and the user test has project administration rights. Now, when I run the CLI, it errors out saying

Successful login to: http://dev:8080/rpc/soap/jirasoapservice-v2 b
y user: test
Warning: user is not an administrator. Custom fields cannot be validated. Use co
rrect custom field ids!

Remote error: com.atlassian.jira.rpc.exception.RemoteValidationException: Custom
field ID 'Milestones' is invalid.
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: com.atlassian.jira.rpc.exception.RemoteValidationException: Custom
field ID 'Milestones' is invalid.
faultActor:
faultNode:
faultDetail:
{}com.atlassian.jira.rpc.exception.RemoteValidationException:null

If I give the user jira-administrators permission, then the same create issue goes through fine. Cant a project administrator create issues with custom filed? Do we need to be jira-administrators to do the same?

Attached the exception (CLI.txt)

3 answers

1 accepted

1 vote
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2012

Yes, you can create issues with custom fields, but, if you are not an administrator you need to use the custom field id instead of the name. This is because the name must be converted to the id based name and administrator authority is required to retrieve the list of all custom fields so the mapping can be made. So, you need to use something like:

customfield_10100

Note: that on the most recent versions of the CLI, non-administrators can now use custom field names as well as the ids.


VijaykarthikaG May 10, 2012

Thanks Bob, that worked!!

p g June 6, 2014

After trying to create an epic I got this message

Remote error: com.atlassian.jira.rpc.exception.RemoteValidationException: {customfield_10401=Epic Name is required.}

After reading this ticket I tried

--action createIssue  --project AMC --type "epic" --summary "This is CLI test" --customfield_10401 "test" --assignee philippe

but I am still getting Error: Unknown flag 'customfield_10401'.

0 votes
Ryan October 31, 2013

Bob, is there something that can be changed at the database level to allow access to the custom field names for non administrators? For us it is a security risk and replacing the custom field names with numbers makes the code much less readable and not portable between our dev and prod system.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2013

Not in the near term, see JCLI-372.

Let me take that back, there is a new API now. Please watch that issue and comment on what version of JIRA you have.

0 votes
Vikas Bhupalam July 5, 2012

I did include the custom fields but i still got the following error, if i remove the custom fields and try to creae an issue on a different project it seems to work fine...

my $call = $jira->call("jira1.createIssue", $auth, {

'project' => 'XYZ',

'type' => 1,

'summary' => $summary,

'description'=>$description,

'assignee' => $user,

'reporter' => $reporter,

'customfield_10202' => $user,

'customfield_10100' => 'Performance',

'customfield_10004' => 88.067,

java.lang.Exception: com.atlassian.jira.rpc.exception.RemoteValidationException: {customfield_10202=Verifier is required., customfield_10100=Initiative is required., customfield_10004=Found in Build is required.} : [] at openJiraTicket.pl line 40.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 5, 2012

You are not using the JCLI, so, your question isn't related to the other question, you should post your own question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events