...
All commands accepts ‘--site’ flag to specify the alias of a Jira site as the target of a command. You can run commands on multiple sites by using ‘site’ flag. In order to use a site you need to add it using ‘jira config:add’ command. If you don’t specify a site when running a command it will use default site specified previously using ‘jira config:set-default’ command.
Running Commands as Another User
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 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.
For Cloud there is nothing we can do about it. For Server and DC you can mitigate this by specifying ‘runAs’ parameter to any command. Of course this requires ‘Jira Administrators’ global permission.