Remove account from JIRA watchers.
main(credential_file, username, issue)
Remove account from JIRA watchers.
Parameters:
Name |
Type |
Description |
Default |
credential_file |
str
|
The credential file containing username and password.
|
required
|
username |
str
|
The username that should be removed from watchers - default will be retrieve from the credential file.
|
required
|
issue |
str
|
The Jira issue identifier e.g.: RA-478
|
required
|
Source code in jira_python_utils/jira_remove_watcher.py
| @click.command()
@click.option('--credential_file', help='credential file containing username and password')
@click.option('--username', help='the username - default will be retrieve from the credential file')
@click.argument('issue')
def main(credential_file: str, username: str, issue: str):
"""Remove account from JIRA watchers.
Args:
credential_file (str): The credential file containing username and password.
username (str): The username that should be removed from watchers - default will be retrieve from the credential file.
issue (str): The Jira issue identifier e.g.: RA-478
"""
rest_url_file = DEFAULT_URL_FILE
check_infile_status(rest_url_file)
if credential_file is None:
credential_file = DEFAULT_CREDENTIAL_FILE
check_infile_status(credential_file)
if issue is None:
error_console.print("issue was not specified")
sys.exit(1)
if username is None:
username = get_username(credential_file)
auth_jira = get_auth(credential_file, get_jira_url(rest_url_file))
console.print(f"Will attempt to remove username '{username}' from issue '{issue}'")
auth_jira.remove_watcher(issue, username)
console.print(f"Removed username '{username}' from watchers for issue '{issue}'")
|