ankitpokhrel / jira-cli

🔥 Feature-rich interactive Jira command line.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

--assignee "Unassigned" picks wrong user

jlevon opened this issue · comments

Describe the bug

Running:

jira issue edit --no-input --assignee "Unassigned"

should set assignee to "Unassigned" but it get set to another user, "Unassigned " instead.

The former doesn't have an email (apparently?) so there is no workaround.

  1. JiraCLI Version:
(Version="1.3.0", GitCommit="ed84fe74f68ba1b2cf0504a931ca09a03b2c9fed", CommitDate="2023-01-02T09:59:32+00:00", GoVersion="go1.19.4", Compiler="gc", Platform="linux/amd64")

  1. Are you using Jira cloud or on-premise jira server?
onprem
SERVER INFO
-----------

Version:         8.20.5
Build Number:    820005
Deployment Type: Server
Default Locale:  

  1. What operating system are you using? Also mention version.
linux centos 7
  1. What terminal are you using? Also mention version.
gnome-terminal
commented

Hi @jlevon, I don't think that's a correct syntax to unassign a user. And since you are passing unknown user, the issue is getting assigned to the default user. This command below should work:

$ jira issue edit --no-input --assignee x

# or 

$ jira issue edit --no-input -ax

Thanks. I now see this is even documented, so apologies for the noise.

Just realised this doesn't quite work: it seems to run the "default assignee" workflow again, so ends up back with the default, instead of unassigned. So it's not useful.

commented

Hi @jlevon, do you still get similar result if you do the following? Looks like I may have accidentally interchanged the implementation of x and thedefault option.

jira issue edit --no-input --assignee default

That gives me:

✗ Unable to find assignee
commented

Is it the same if you do?

jira issue assign <key> default

That did it, thanks!

Want a PR to update the docs on this?

commented

I think this is a bug. There are few things that needs to be fixed:

  • jira issue assign <key> default should send request to set default assignee. Right now it is sending request to unassign. It works in my setup because default assignee is not set.
  • jira issue assign <key> x should send request to unassign. Right now it is sending request to set default assignee. It works in my setup because default assignee is not set.
  • jira issue edit <key> --no-input --assignee default should not complain about being unable to find assignee and should have more or less similar behavior as jira issue assign.
  • There could be same issue in create and epic create/edit.

I am open for PRs, this could be bit of a work tho :)

I see, yeah, that sounds a bit beyond me. Happy to test out any PRs though.