Open klaudiusz223 opened 2 years ago
Hi @klaudiusz223, security field is not a custom field as per your config and setting this field is not directly supported. However, you can try to update the config file manually to see if it works.
- name: Security
key: security
schema:
datatype: array
items: json
# jira issue create --custom security="Level 1"
Note that you need to provide correct datatype in schema
, it should be json array I think.
Hi @ankitpokhrel Thank You for the answer. I have not tried to set the security field yet because in my case it can create a ticket with the default secuirty level, which means that I will not be able to access it. Unfortunately, I have no influence on it. I don't have administrator privileges in JIRA. Besides, I read somewhere that setting security level is not possible when creating a ticket by REST API, but it can be changed after creation. If this is the case, it means that in my case it will not work for the reasons I wrote above.
But it turned out that I am forced to set different customfield and unfortunately without success. my setup is
- name: functional
key: customfield_11111
schema:
datatype: array
items: json
the correct request has the form (succeeded using curl)
"customfield_11111": [
{
"id": "20009"
},
{
"id": "20010"
}
],
If I run using parameters
--custom functional = {"id": "20009"}, {"id": "20010"}
it is transformed in body to
"customfield_11111": ["{id: 20009}", "{id: 20010}"]
and should be
"customfield_11111": [{"id": "20009"}, {"id": "20010"}]
I tried several ways, quoting \ using ', but with no success. e.g.
--custom functional = {id: 20009}, {id: 20010}
--custom functional = {"id": "20009"}, {"id": "20010"}
--custom functional={\"id\":"20009"},{"id":"20010"}
--custom functional='{"id":"20009"},{"id":"20010"}'
--custom functional='{'id':"20009"},{"id":"20010"}'
I'm not sure if this is a bug or I do something wrong
I'm also unable to set custom fields, I am failing to get the example story-points working. I've tried both the name and customfield_
I also am unable to set story points.
It is present as an available createmeta field:
curl -k --request GET \
--url "${JIRA_SERVER?}/rest/api/2/issue/createmeta?projectKeys=PE&expand=projects.issuetypes.fields" \
--user "<user>:${JIRA_API_TOKEN?}"
output contains:
"customfield_10006":{"required":false,"schema":{"type":"number","custom":"com.atlassian.jira.plugin.system.customfieldtypes:float","customId":10006},"name":"Story Points","fieldId":"customfield_10006","hasDefaultValue":false,"operations":["set"]}
I have added the following to my .config/.jira/.config.yml
file:
fields:
custom:
- name: Story Points
key: customfield_10006
schema:
datatype: number
However, none of these has an effect on ISSUE-123 (even though visiting ISSUE-123 via Web UI does allow me to edit the custom "Story Points" field):
jira issue edit ISSUE-123 --custom=story-points=1 --no-input
jira issue edit ISSUE-123 --custom story-points=2 --no-input
jira issue edit ISSUE-123 --custom "story points"=3 --no-input
jira issue edit ISSUE-123 --custom "Story Points"=4 --no-input
jira issue edit ISSUE-123 --custom="Story Points"=3 --no-input --debug
jira issue edit ISSUE-123 --custom=customfield_10006=4 --no-input --debug
I can see the following output in the terminal:
✓ Issue updated
JIRA_SERVER/browse/ISSUE-123
However, the story point in ISSUE-123 remain unchanged.
Just checked on Jira v8.22.1 and it seem to be working fine in my installation.
@MattPD your config looks ok to me, could you please mention what version of jira you are using? You can get it with jira serverinfo
if you are using the latest version of jira-cli.
@rhysjtevans Any additional details to help debug the issue would be great (eg: is this happening for just story points custom field or others too?).
Interesting--I do have the latest release but it doesn't appear to be recognized:
$ jira serverinfo
Error: unknown command "serverinfo" for "jira"
Run 'jira --help' for usage.
unknown command "serverinfo" for "jira"
$ jira version
(Version="1.1.0", GitCommit="3b93e147eac468ad985bdece27469153b4bb2814", CommitDate="2022-08-14T08:10:40+00:00", GoVersion="go1.18.3", Compiler="gc", Platform="linux/arm64")
I can wait for the next release if this requires the latest commit build--or perhaps there's some way I can check this via Curl?
FWIW, the bottom of my Jira Web UI says "Atlassian Jira Project Management Software (v8.20.5#820005" and visiting the AboutPage.jspa shows
Jira v8.20.5
Copyright © 2002 - 2022 Atlassian Corporation Pty Ltd.
Hi @MattPD, serverinfo
command is not yet released, my bad. I checked this on Jira v8.20.5 and the story points is updated successfully in my installation.
It would be helpful if someone can debug this a bit and provide more info.
@ankitpokhrel Thanks for great software. I would like to set security level. Is it possible to set it using custom fields? When I run command
I've got this answer
I have successfully run
init jira
but there is no "security" field in my config file. Should I add it manually? I don't know how to add such type of field. Any hint will be appreciated.