Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First command above uses an argument to specify an issue. The second command uses a flag to specify an issue.

Repeated Flags

Sometimes a flag can be repeated multiple times. Both of following examples are valid and do the same thing.

Code Block
languagebash
jira worklog:get-worklogs --worklogId=18900 --worklogId=18901 --worklogId=18902 
Code Block
languagebash
jira worklog:get-worklogs --worklogId=18900 18901 18902 

Boolean Flags

Boolean flags have usually a default value and you don’t need to specify it when it has a default value. Yes no for boolean flags are specified with ‘--no’ prefix.

Code Block
--notifyUsers
--no-notifyUser

Date Flags

Most of the time Date Flags/Arguments can be specified in two ways. Following examples specifies the same instant in time.

  • UNIX timestamp in milliseconds. Example: 1524815284277

  • ISO 8601 string format (YYYY-MM-DDThh:mm:ss.sTZD). Example: 2018-04-27T07:48:04.000+0200, 2018-04-27T07:48:04.00-0230

The part specified with + is timezone information. The part specified with . is milliseconds part.

Help

You can use ‘--help' to see all available arguments and flags for a command.

...

Running Commands as Another User

Info

Only available for DC or Server versions of Jira

When adding a site to CLI, you provide an Atlassian account credentials or username for running commands. Normally all commands run as this user but sometimes you may want to run a command as another user. Some Jira APIs doesn’t allow a to specify a user for an action but some APIs allow a user to be specified. For example when adding a ‘Vote’ for an issue, you can’t specify which user voting so it always uses the user you have specified when adding the site. But when adding a ‘Watcher’ for an issue, API allows you to specify a user as watcher so you can make another user watch the issue other than the user you specify when configuring the site. Very similarly you can’t specify a user when adding a comment to an issue or when logging work to an issue.

...