Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Issues with issue-type in a national language cannot be created with option --noedit #207

Open
volker-schukai opened this issue Aug 31, 2018 · 5 comments

Comments

@volker-schukai
Copy link

volker-schukai commented Aug 31, 2018

I try to create an issue in one line without an editor.

Version 1.0.20

create a new issue

jira create -p myProject --noedit -iBug -o summary="Test"

works fine, but

jira create -p myProject --noedit -iAufgabe -o summary="Test"

doesn´t work.

I think it depends on the jira-api

jira issuetypes -p MyProject

returns correct:

Aufgabe:   My Description
Bug:          Bugs....

Jira-API

this api-call doesn´t work (issuetypes is empty):
/rest/api/2/issue/createmeta?projectKeys=MyProject&issuetypeNames=Aufgabe&expand=projects.issuetypes.fields

this api-call works (issuetypes returned):
/rest/api/2/issue/createmeta?projectKeys=MyProject&issuetypeNames=Task&expand=projects.issuetypes.fields

but if I try the following

jira create -p myProject --noedit -iTask -o summary="Test"

then I get the following message: ERROR Invalid Usage: Project MyProject and IssueType Task not found

@schnoddelbotz
Copy link

Came here as I had a 'similar' issue... I was unable to get the overrides to work. I'm also on a german Jira instance and it works for me now -- so I assume it's really unrelated to Jira's language. Of course, you should provide a valid issue type (as provided by jira issutypes -p YourProject).

What I didn't figure out from documentation was how to use the overrides provided via command line. Maybe docs could be improved a bit on this aspect?

Anyhow, for reference: To make -o summary=... work for one-line ticket creation, edit ~/.jira.d/templates/create and add something like shown here:

fields:
  
  issuetype:
    name: Bug
  
  {{ if .overrides.summary }}summary: {{ .overrides.summary }}{{ else }}summary: {{ end }}

  customfield_...:
    name: 'foobar'

@volker-schukai could you please give it a try and report back?
If it still doesn't work, please provide the error message for your "doesn't work" command.

@sucotronic
Copy link

Same problem here, using jira cloud instance:

$ jira issuetypes -p PREZ 
Tarea:        Una tarea que se debe realizar.
Subtarea:     La subtarea de la incidencia.
Mejora:       La mejora o perfeccionamiento de una función o tarea existente.
Error:        <no value>
Épica:        Creado por JIRA Software - no editar ni eliminar. Tipo de incidencia para una historia del usuario grande que debe desglosarse.

But then:

$ jira create -p PREZ -i Error
usage: jira create [<flags>]

Create issue

Global flags:
      --help                   Show context-sensitive help (also try --help-long and --help-man).
  -v, --verbose ...            Increase verbosity for debugging
  -e, --endpoint=ENDPOINT      Base URI to use for Jira
  -k, --insecure               Disable TLS certificate verification
  -Q, --quiet                  Suppress output to console
      --unixproxy=UNIXPROXY    Path for a unix-socket proxy
      --socksproxy=SOCKSPROXY  Address for a socks proxy
  -u, --user=USER              user name used within the Jira service
      --login=LOGIN            login name that corresponds to the user used for authentication

Optional flags:
  -b, --browse                 Open issue(s) in browser after operation
      --editor=EDITOR          Editor to use
  -t, --template=TEMPLATE      Template to use for output
      --noedit                 Disable opening the editor
  -p, --project=PROJECT        project to create issue in
  -i, --issuetype=ISSUETYPE    issuetype in to create
  -m, --comment=COMMENT        Comment message for issue
  -o, --override=OVERRIDE ...  Set issue property
      --saveFile=SAVEFILE      Write issue as yaml to file

ERROR Invalid Usage: Project PREZ and IssueType Error not found

If I enable debug (-vvv), the client is sending:

GET /rest/api/2/issue/createmeta?projectKeys=PREZ&issuetypeNames=Error&expand=projects.issuetypes.fields

and the server is replying:

{
  "expand": "projects",
  "projects": [
    {
      "expand": "issuetypes",
      "self": "https://xxxxx.atlassian.net/rest/api/2/project/11708",
      "id": "11708",
      "key": "PREZ",
      "name": "xxxxx",
      "avatarUrls": {
        "48x48": "https://xxxx.atlassian.net/secure/projectavatar?pid=11708&avatarId=15828",
        "24x24": "https://xxxxx.atlassian.net/secure/projectavatar?size=small&pid=11708&avatarId=15828",
        "16x16": "https://xxxxx.atlassian.net/secure/projectavatar?size=xsmall&pid=11708&avatarId=15828",
        "32x32": "https://xxxxx.atlassian.net/secure/projectavatar?size=medium&pid=11708&avatarId=15828"
      },
      "issuetypes": [
        
      ]
    }
  ]
}

@jgraglia
Copy link
Contributor

jgraglia commented Apr 2, 2019

I had the same issue. My workaroung was to change my langage to "English (US)" in my jira profile.

Now jira issuetypes list the types in english. And I can create an issue with
--issuetype Bug

Before that, my JIRA profile was in FR, and --issuetype Bogue did not work even if listed by jira issuetypes command

@examinedliving
Copy link

For what it's worth, the only thing that got this working for me was setting the project as an environmental variable. I didn't have a language issue, but I got the same error you did every time. When I set JIRA_PROJECT and used %JIRA_PROJECT% (I'm on Windows), it worked. Nothing else I tried did it. Doesn't make sense to me, but that's what I got.

@volker-schukai
Copy link
Author

volker-schukai commented Jul 16, 2019

@volker-schukai could you please give it a try and report back?
If it still doesn't work, please provide the error message for your "doesn't work" command.

ok, thats workaround works if I omit the argument --issuetype
however, the main problem remains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants