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

Creating sub-tasks doesn't work or is not obvious #69

Closed
estahn opened this issue Feb 13, 2017 · 9 comments
Closed

Creating sub-tasks doesn't work or is not obvious #69

estahn opened this issue Feb 13, 2017 · 9 comments

Comments

@estahn
Copy link

estahn commented Feb 13, 2017

I tried to create a sub-task without success. Would it be possible to update the documentation for this.

My template:

fields:
  project:
    key: FOOBAR
  issuetype:
    name: Sub-Task
  summary: {{ or .overrides.summary "" }}
  parent:
    key: FOOBAR-307
  priority:
    name: Low
  description: |~

  assignee:
    name:
  reporter:
    name: enricostahn

Error Message:

2017-02-13T13:19:23.274+11:00 ERROR [cli.go:421] Field parent is not editable
2017-02-13T13:19:23.274+11:00 ERROR [main.go:534] Field parent is not editable
@wrouesnel
Copy link
Contributor

Did you eventually get this to work? It's essentially the driving motivation for me using this tool (command-line spamming "here's the next broken thing I'm dealing with...")

@coryb
Copy link
Contributor

coryb commented Feb 27, 2017

Hey, sorry I am confused. I have not used Sub-Task issuetype before. Are you trying to create a new jira issue of type Sub-Task, or are you trying to edit an issue of type Sub-Task? I think the error Field parent is not editable would only happen when editing a jira issue, and Jira can be pretty fussy about what it allows in the POST data on update. Have you tried deleting the:

parent:
  key: FOOBAR-307

from the document before you submit the edits?

-Cory

@wrouesnel
Copy link
Contributor

wrouesnel commented Feb 27, 2017

I'm trying to create a subtask.

So my command is:

$ jira -p SOMEPROJECT create

And then I add the fields.parent.key = SOMEPROJECT-1 element.

The response I get is:

2017-02-27T12:15:56.047+11:00 ERROR [cli.go:421] Field parent is not editable
edit again? [Y/n]: 
2017-02-27T12:16:00.190+11:00 ERROR [cli.go:243] response status: 400 Bad Request
2017-02-27T12:16:00.191+11:00 ERROR [commands.go:443] Unexpected Response From POST:
HTTP/1.1 400 Bad Request
Connection: close
Transfer-Encoding: chunked
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token, X-Atlassian-Token, x-atlassian-mau-ignore
Access-Control-Allow-Origin: <removed due to possible sensitivity>
Cache-Control: no-cache, no-store, no-transform
Content-Type: application/json;charset=UTF-8
Date: Mon, 27 Feb 2017 01:20:01 GMT
Server: Apache-Coyote/1.1
X-Arequestid: 740x10422385x1
X-Asen: SEN-2175083
X-Asessionid: 18a7emu
X-Ausername: <removed due to possible sensitivity>
X-Content-Type-Options: nosniff
X-Seraph-Loginreason: OK
X-Ua-Compatible: IE=Edge

67
{"errorMessages":[],"errors":{"issuetype":"Issue type 3 is not a sub-task but a parent is specified."}}
0

EDIT: Hm..actually the task type is probably the problem...

@coryb
Copy link
Contributor

coryb commented Feb 27, 2017

Okay, thanks for the clarification, I will try to create a test for the scenario and try to figure out what is necessary.
-Cory

@wrouesnel
Copy link
Contributor

Possibly subtasks would warrant being their own subcommand?

i.e. for my environment I would end up making a script which sends an issue-type override - but it looks like whether a particular issue type can be a subtask is installation-dependent - so I guess maybe it would need to prompt a template with a comment of "possible values" ?

@coryb
Copy link
Contributor

coryb commented Feb 27, 2017

According to the REST documentation:

the issueType field must correspond to a sub-task issue type (you can use /issue/createmeta to discover sub-task issue types), and
you must provide a parent field in the issue create request containing the id or key of the parent issue.

So perhaps try:

parent: FOOBAR-307

instead of:

parent:
  key: FOOBAR-307

A subtask command probably makes sense, usage something jira subtask ISSUE

coryb added a commit that referenced this issue Feb 27, 2017
@coryb
Copy link
Contributor

coryb commented Feb 27, 2017

I just released a new version with a subtask command. Try it out and see if that works for you. The binaries are here: https://github.com/Netflix-Skunkworks/go-jira/releases/tag/v0.1.11

@wrouesnel
Copy link
Contributor

Great! I'll give it a go tomorrow when I'm back in the office.

@wrouesnel
Copy link
Contributor

Working great! I'd consider this closed.

@coryb coryb closed this as completed Mar 1, 2017
pdericson pushed a commit to pdericson/go-jira that referenced this issue Sep 14, 2017
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

3 participants