1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/modules/web_infrastructure/jira.py

761 lines
24 KiB
Python
Raw Normal View History

2020-03-09 10:11:07 +01:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Steve Smith <ssmith@atlassian.com>
2020-03-09 10:11:07 +01:00
# Atlassian open-source approval reference OSR-76.
#
# Copyright (c) 2020, Per Abildgaard Toft <per@minfejl.dk> Search and update function
# Copyright (c) 2021, Brandon McNama <brandonmcnama@outlook.com> Issue attachment functionality
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
#
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
2020-03-09 10:11:07 +01:00
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r"""
2020-03-09 10:11:07 +01:00
module: jira
short_description: Create and modify issues in a JIRA instance
2020-03-09 10:11:07 +01:00
description:
- Create and modify issues in a JIRA instance.
options:
uri:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: true
description:
- Base URI for the JIRA instance.
operation:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: true
aliases: [ command ]
choices: [ attach, comment, create, edit, fetch, link, search, transition, update ]
2020-03-09 10:11:07 +01:00
description:
- The operation to perform.
username:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- The username to log-in with.
- Must be used with I(password). Mutually exclusive with I(token).
2020-03-09 10:11:07 +01:00
password:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
description:
- The password to log-in with.
- Must be used with I(username). Mutually exclusive with I(token).
token:
type: str
description:
- The personal access token to log-in with.
- Mutually exclusive with I(username) and I(password).
version_added: 4.2.0
2020-03-09 10:11:07 +01:00
project:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- The project for this operation. Required for issue creation.
summary:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- The issue summary, where appropriate.
- Note that JIRA may not allow changing field values on specific transitions or states.
2020-03-09 10:11:07 +01:00
description:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- The issue description, where appropriate.
- Note that JIRA may not allow changing field values on specific transitions or states.
2020-03-09 10:11:07 +01:00
issuetype:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- The issue type, for issue creation.
issue:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- An existing issue key to operate on.
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
aliases: ['ticket']
2020-03-09 10:11:07 +01:00
comment:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- The comment text to add.
- Note that JIRA may not allow changing field values on specific transitions or states.
2020-03-09 10:11:07 +01:00
comment_visibility:
type: dict
description:
- Used to specify comment comment visibility.
- See U(https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comments/#api-rest-api-2-issue-issueidorkey-comment-post) for details.
suboptions:
type:
description:
- Use type to specify which of the JIRA visibility restriction types will be used.
type: str
required: true
choices: [group, role]
value:
description:
- Use value to specify value corresponding to the type of visibility restriction. For example name of the group or role.
type: str
required: true
version_added: '3.2.0'
2020-03-09 10:11:07 +01:00
status:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- Only used when I(operation) is C(transition), and a bit of a misnomer, it actually refers to the transition name.
2020-03-09 10:11:07 +01:00
assignee:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- Sets the the assignee when I(operation) is C(create), C(transition) or C(edit).
- Recent versions of JIRA no longer accept a user name as a user identifier. In that case, use I(account_id) instead.
- Note that JIRA may not allow changing field values on specific transitions or states.
account_id:
type: str
description:
- Sets the account identifier for the assignee when I(operation) is C(create), C(transition) or C(edit).
- Note that JIRA may not allow changing field values on specific transitions or states.
version_added: 2.5.0
2020-03-09 10:11:07 +01:00
linktype:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- Set type of link, when action 'link' selected.
inwardissue:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- Set issue from which link will be created.
outwardissue:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: str
2020-03-09 10:11:07 +01:00
required: false
description:
- Set issue to which link will be created.
fields:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: dict
2020-03-09 10:11:07 +01:00
required: false
description:
- This is a free-form data structure that can contain arbitrary data. This is passed directly to the JIRA REST API
(possibly after merging with other required data, as when passed to create). See examples for more information,
and the JIRA REST API for the structure required for various fields.
- When passed to comment, the data structure is merged at the first level since community.general 4.6.0. Useful to add JIRA properties for example.
- Note that JIRA may not allow changing field values on specific transitions or states.
default: {}
2020-03-09 10:11:07 +01:00
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
jql:
required: false
description:
- Query JIRA in JQL Syntax, e.g. 'CMDB Hostname'='test.example.com'.
type: str
version_added: '0.2.0'
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
maxresults:
required: false
description:
- Limit the result of I(operation=search). If no value is specified, the default jira limit will be used.
- Used when I(operation=search) only, ignored otherwise.
type: int
version_added: '0.2.0'
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
2020-03-09 10:11:07 +01:00
timeout:
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
type: float
2020-03-09 10:11:07 +01:00
required: false
description:
- Set timeout, in seconds, on requests to JIRA API.
default: 10
validate_certs:
required: false
description:
- Require valid SSL certificates (set to C(false) if you'd like to use self-signed certificates)
2020-03-09 10:11:07 +01:00
default: true
type: bool
attachment:
type: dict
version_added: 2.5.0
description:
- Information about the attachment being uploaded.
suboptions:
filename:
required: true
type: path
description:
- The path to the file to upload (from the remote node) or, if I(content) is specified,
the filename to use for the attachment.
content:
type: str
description:
- The Base64 encoded contents of the file to attach. If not specified, the contents of I(filename) will be
used instead.
mimetype:
type: str
description:
- The MIME type to supply for the upload. If not specified, best-effort detection will be
done.
2020-03-09 10:11:07 +01:00
notes:
- "Currently this only works with basic-auth, or tokens."
- "To use with JIRA Cloud, pass the login e-mail as the I(username) and the API token as I(password)."
2020-03-09 10:11:07 +01:00
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
author:
- "Steve Smith (@tarka)"
- "Per Abildgaard Toft (@pertoft)"
- "Brandon McNama (@DWSR)"
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
"""
2020-03-09 10:11:07 +01:00
EXAMPLES = r"""
2020-03-09 10:11:07 +01:00
# Create a new issue and add a comment to it:
- name: Create an issue
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
project: ANS
operation: create
summary: Example Issue
description: Created using Ansible
issuetype: Task
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
args:
fields:
customfield_13225: "test"
customfield_12931: {"value": "Test"}
2020-03-09 10:11:07 +01:00
register: issue
- name: Comment on issue
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: comment
comment: A comment added by Ansible
- name: Comment on issue with restricted visibility
community.general.jira:
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: comment
comment: A comment added by Ansible
comment_visibility:
type: role
value: Developers
- name: Comment on issue with property to mark it internal
community.general.jira:
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: comment
comment: A comment added by Ansible
fields:
properties:
- key: 'sd.public.comment'
value:
internal: true
2020-03-09 10:11:07 +01:00
# Assign an existing issue using edit
- name: Assign an issue using free-form fields
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key}}'
operation: edit
assignee: ssmith
# Create an issue with an existing assignee
- name: Create an assigned issue
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
project: ANS
operation: create
summary: Assigned issue
description: Created and assigned using Ansible
issuetype: Task
assignee: ssmith
# Edit an issue
- name: Set the labels on an issue using free-form fields
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: edit
args:
fields:
labels:
- autocreated
- ansible
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
# Updating a field using operations: add, set & remove
- name: Change the value of a Select dropdown
community.general.jira:
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: update
args:
fields:
customfield_12931: [ {'set': {'value': 'Virtual'}} ]
customfield_13820: [ {'set': {'value':'Manually'}} ]
register: cmdb_issue
delegate_to: localhost
2020-03-09 10:11:07 +01:00
# Retrieve metadata for an issue and use it to create an account
- name: Get an issue
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
project: ANS
operation: fetch
issue: ANS-63
register: issue
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
# Search for an issue
# You can limit the search for specific fields by adding optional args. Note! It must be a dict, hence, lastViewed: null
- name: Search for an issue
community.general.jira:
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
project: ANS
operation: search
maxresults: 10
jql: project=cmdb AND cf[13225]="test"
args:
fields:
lastViewed: null
register: issue
2020-03-09 10:11:07 +01:00
- name: Create a unix account for the reporter
become: true
user:
name: '{{ issue.meta.fields.creator.name }}'
comment: '{{ issue.meta.fields.creator.displayName }}'
# You can get list of valid linktypes at /rest/api/2/issueLinkType
# url of your jira installation.
- name: Create link from HSP-1 to MKY-1
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
operation: link
linktype: Relates
inwardissue: HSP-1
outwardissue: MKY-1
# Transition an issue
- name: Resolve the issue
community.general.jira:
2020-03-09 10:11:07 +01:00
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: '{{ issue.meta.key }}'
operation: transition
status: Resolve Issue
account_id: 112233445566778899aabbcc
fields:
resolution:
name: Done
description: I am done! This is the last description I will ever give you.
# Attach a file to an issue
- name: Attach a file
community.general.jira:
uri: '{{ server }}'
username: '{{ user }}'
password: '{{ pass }}'
issue: HSP-1
operation: attach
attachment:
filename: topsecretreport.xlsx
2020-03-09 10:11:07 +01:00
"""
import base64
import binascii
2020-03-09 10:11:07 +01:00
import json
import mimetypes
import os
import random
import string
import traceback
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper, cause_changes
from ansible.module_utils.six.moves.urllib.request import pathname2url
from ansible.module_utils.common.text.converters import to_text, to_bytes, to_native
2020-03-09 10:11:07 +01:00
from ansible.module_utils.urls import fetch_url
class JIRA(StateModuleHelper):
module = dict(
2020-03-09 10:11:07 +01:00
argument_spec=dict(
attachment=dict(type='dict', options=dict(
content=dict(type='str'),
filename=dict(type='path', required=True),
mimetype=dict(type='str')
)),
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
uri=dict(type='str', required=True),
operation=dict(
type='str',
choices=['attach', 'create', 'comment', 'edit', 'update', 'fetch', 'transition', 'link', 'search'],
aliases=['command'], required=True
),
username=dict(type='str'),
password=dict(type='str', no_log=True),
token=dict(type='str', no_log=True),
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
project=dict(type='str', ),
summary=dict(type='str', ),
description=dict(type='str', ),
issuetype=dict(type='str', ),
issue=dict(type='str', aliases=['ticket']),
comment=dict(type='str', ),
comment_visibility=dict(type='dict', options=dict(
type=dict(type='str', choices=['group', 'role'], required=True),
value=dict(type='str', required=True)
)),
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
status=dict(type='str', ),
assignee=dict(type='str', ),
2020-03-09 10:11:07 +01:00
fields=dict(default={}, type='dict'),
Enabling validation-modules for web_infrastructure modules (#1200) * fixed validation-modules for apache2_mod_proxy.py * fixed validation-modules for apache2_module.py * fixed validation-modules for deploy_helper.py The ignore lines were put back in place because add_file_common_args=True is used and the module inherits a number of options that do not show up in the documentation (nor should they). * fixed validation-modules for ejabberd_user.py * fixed validation-modules for gunicorn.py * fixed validation-modules for htpasswd.py * fixed validation-modules for jenkins_job.py * fixed validation-modules for jenkins_job_info.py * fixed validation-modules for jenkins_plugin.py * fixed validation-modules for jenkins_script.py * fixed validation-modules for jira.py * fixed validation-modules for nginx_status_facts.py * fixed validation-modules for rundeck_acl_policy.py * fixed validation-modules for rundeck_project.py * fixed validation-modules for supervisorctl.py * fixed validation-modules for taiga_issue.py * fixed pylint mistake in plugins/modules/web_infrastructure/jenkins_job_info.py * removed ignore lines for almost-all web_infrastructure modules * rolled back ignore lines for nested sophos_utm modules that were not adjusted * Removed doc-missing-type from ignore-2.11.txt for deploy_helper and jenkins_plugin * When adding lines back to ignore files, we added more than it was before. Removing. * Rolled back deprecation line in ignore-2.9.txt for nginx_status_facts * Rolled back yet another line in ignore-2.9.txt for nginx_status_facts * Fixed argument_spec and docs for crypt_scheme parameter in htpasswd, per PR * Added extends_documentation_fragment:files to deploy_helper and jenkins_plugin * Removed long-deprecated option params from jenkins_plugin, removed validate-modules lines from ignore files for that module * Update plugins/modules/web_infrastructure/htpasswd.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-31 13:53:57 +01:00
linktype=dict(type='str', ),
inwardissue=dict(type='str', ),
outwardissue=dict(type='str', ),
jql=dict(type='str', ),
Added search function to jira module and bugfixes (#22) * Added search function to jira module * Added jira Operations in update function * Fixed Whitepsaces * Fixed Author header * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: John R Barker <john@johnrbarker.com> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changelog framgents and update with review comments * Resolved https://github.com/ansible-collections/community.general/issues/109 * Added example for Transsition with comments * Fixed Whitespaces * Fixed whitepsaces again * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added changes from Andersson007 * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Updated Changelog framgnets as per reviews * Update changelogs/fragments/22-jira.yaml Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> * Added max results per review request, which supports limiting number of resuted searches from the Jira API. * Removed whitespace * Removed version_added per request * Update plugins/modules/web_infrastructure/jira.py Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru> Co-authored-by: Per Abildgaard Toft <pto@netic.dk> Co-authored-by: John R Barker <john@johnrbarker.com> Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-04-09 09:29:26 +02:00
maxresults=dict(type='int'),
2020-03-09 10:11:07 +01:00
timeout=dict(type='float', default=10),
validate_certs=dict(default=True, type='bool'),
account_id=dict(type='str'),
2020-03-09 10:11:07 +01:00
),
mutually_exclusive=[
['username', 'token'],
['password', 'token'],
['assignee', 'account_id'],
],
required_together=[
['username', 'password'],
],
required_one_of=[
['username', 'token'],
],
required_if=(
('operation', 'attach', ['issue', 'attachment']),
('operation', 'create', ['project', 'issuetype', 'summary']),
('operation', 'comment', ['issue', 'comment']),
('operation', 'fetch', ['issue']),
('operation', 'transition', ['issue', 'status']),
('operation', 'link', ['linktype', 'inwardissue', 'outwardissue']),
('operation', 'search', ['jql']),
),
2020-03-09 10:11:07 +01:00
supports_check_mode=False
)
state_param = 'operation'
def __init_module__(self):
if self.vars.fields is None:
self.vars.fields = {}
if self.vars.assignee:
self.vars.fields['assignee'] = {'name': self.vars.assignee}
if self.vars.account_id:
self.vars.fields['assignee'] = {'accountId': self.vars.account_id}
self.vars.uri = self.vars.uri.strip('/')
self.vars.set('restbase', self.vars.uri + '/rest/api/2')
@cause_changes(on_success=True)
def operation_create(self):
createfields = {
'project': {'key': self.vars.project},
'summary': self.vars.summary,
'issuetype': {'name': self.vars.issuetype}}
if self.vars.description:
createfields['description'] = self.vars.description
# Merge in any additional or overridden fields
if self.vars.fields:
createfields.update(self.vars.fields)
data = {'fields': createfields}
url = self.vars.restbase + '/issue/'
self.vars.meta = self.post(url, data)
@cause_changes(on_success=True)
def operation_comment(self):
data = {
'body': self.vars.comment
}
# if comment_visibility is specified restrict visibility
if self.vars.comment_visibility is not None:
data['visibility'] = self.vars.comment_visibility
# Use 'fields' to merge in any additional data
if self.vars.fields:
data.update(self.vars.fields)
url = self.vars.restbase + '/issue/' + self.vars.issue + '/comment'
self.vars.meta = self.post(url, data)
@cause_changes(on_success=True)
def operation_edit(self):
data = {
'fields': self.vars.fields
}
url = self.vars.restbase + '/issue/' + self.vars.issue
self.vars.meta = self.put(url, data)
@cause_changes(on_success=True)
def operation_update(self):
data = {
"update": self.vars.fields,
}
url = self.vars.restbase + '/issue/' + self.vars.issue
self.vars.meta = self.put(url, data)
def operation_fetch(self):
url = self.vars.restbase + '/issue/' + self.vars.issue
self.vars.meta = self.get(url)
def operation_search(self):
url = self.vars.restbase + '/search?jql=' + pathname2url(self.vars.jql)
if self.vars.fields:
fields = self.vars.fields.keys()
url = url + '&fields=' + '&fields='.join([pathname2url(f) for f in fields])
if self.vars.maxresults:
url = url + '&maxResults=' + str(self.vars.maxresults)
self.vars.meta = self.get(url)
@cause_changes(on_success=True)
def operation_transition(self):
# Find the transition id
turl = self.vars.restbase + '/issue/' + self.vars.issue + "/transitions"
tmeta = self.get(turl)
target = self.vars.status
tid = None
for t in tmeta['transitions']:
if t['name'] == target:
tid = t['id']
break
else:
raise ValueError("Failed find valid transition for '%s'" % target)
fields = dict(self.vars.fields)
if self.vars.summary is not None:
fields.update({'summary': self.vars.summary})
if self.vars.description is not None:
fields.update({'description': self.vars.description})
# Perform it
data = {'transition': {"id": tid},
'fields': fields}
if self.vars.comment is not None:
data.update({"update": {
"comment": [{
"add": {"body": self.vars.comment}
}],
}})
url = self.vars.restbase + '/issue/' + self.vars.issue + "/transitions"
self.vars.meta = self.post(url, data)
@cause_changes(on_success=True)
def operation_link(self):
data = {
'type': {'name': self.vars.linktype},
'inwardIssue': {'key': self.vars.inwardissue},
'outwardIssue': {'key': self.vars.outwardissue},
}
url = self.vars.restbase + '/issueLink/'
self.vars.meta = self.post(url, data)
@cause_changes(on_success=True)
def operation_attach(self):
v = self.vars
filename = v.attachment.get('filename')
content = v.attachment.get('content')
if not any((filename, content)):
raise ValueError('at least one of filename or content must be provided')
mime = v.attachment.get('mimetype')
if not os.path.isfile(filename):
raise ValueError('The provided filename does not exist: %s' % filename)
content_type, data = self._prepare_attachment(filename, content, mime)
url = v.restbase + '/issue/' + v.issue + '/attachments'
return True, self.post(
url, data, content_type=content_type, additional_headers={"X-Atlassian-Token": "no-check"}
)
# Ideally we'd just use prepare_multipart from ansible.module_utils.urls, but
# unfortunately it does not support specifying the encoding and also defaults to
# base64. Jira doesn't support base64 encoded attachments (and is therefore not
# spec compliant. Go figure). I originally wrote this function as an almost
# exact copypasta of prepare_multipart, but ran into some encoding issues when
# using the noop encoder. Hand rolling the entire message body seemed to work
# out much better.
#
# https://community.atlassian.com/t5/Jira-questions/Jira-dosen-t-decode-base64-attachment-request-REST-API/qaq-p/916427
#
# content is expected to be a base64 encoded string since Ansible doesn't
# support passing raw bytes objects.
@staticmethod
def _prepare_attachment(filename, content=None, mime_type=None):
def escape_quotes(s):
return s.replace('"', '\\"')
boundary = "".join(random.choice(string.digits + string.ascii_letters) for dummy in range(30))
name = to_native(os.path.basename(filename))
if not mime_type:
try:
mime_type = mimetypes.guess_type(filename or '', strict=False)[0] or 'application/octet-stream'
except Exception:
mime_type = 'application/octet-stream'
main_type, sep, sub_type = mime_type.partition('/')
if not content and filename:
with open(to_bytes(filename, errors='surrogate_or_strict'), 'rb') as f:
content = f.read()
else:
try:
content = base64.b64decode(content)
except binascii.Error as e:
raise Exception("Unable to base64 decode file content: %s" % e)
lines = [
"--{0}".format(boundary),
'Content-Disposition: form-data; name="file"; filename={0}'.format(escape_quotes(name)),
"Content-Type: {0}".format("{0}/{1}".format(main_type, sub_type)),
'',
to_text(content),
"--{0}--".format(boundary),
""
]
return (
"multipart/form-data; boundary={0}".format(boundary),
"\r\n".join(lines)
)
def request(
self,
url,
data=None,
method=None,
content_type='application/json',
additional_headers=None
):
if data and content_type == 'application/json':
data = json.dumps(data)
headers = {}
if isinstance(additional_headers, dict):
headers = additional_headers.copy()
# NOTE: fetch_url uses a password manager, which follows the
# standard request-then-challenge basic-auth semantics. However as
# JIRA allows some unauthorised operations it doesn't necessarily
# send the challenge, so the request occurs as the anonymous user,
# resulting in unexpected results. To work around this we manually
# inject the auth header up-front to ensure that JIRA treats
# the requests as authorized for this user.
if self.vars.token is not None:
headers.update({
"Content-Type": content_type,
"Authorization": "Bearer %s" % self.vars.token,
})
else:
auth = to_text(base64.b64encode(to_bytes('{0}:{1}'.format(self.vars.username, self.vars.password),
errors='surrogate_or_strict')))
headers.update({
"Content-Type": content_type,
"Authorization": "Basic %s" % auth,
})
response, info = fetch_url(
self.module, url, data=data, method=method, timeout=self.vars.timeout, headers=headers
)
if info['status'] not in (200, 201, 204):
error = None
try:
error = json.loads(info['body'])
except Exception:
msg = 'The request "{method} {url}" returned the unexpected status code {status} {msg}\n{body}'.format(
status=info['status'],
msg=info['msg'],
body=info.get('body'),
url=url,
method=method,
)
self.module.fail_json(msg=to_native(msg), exception=traceback.format_exc())
if error:
msg = []
for key in ('errorMessages', 'errors'):
if error.get(key):
msg.append(to_native(error[key]))
if msg:
self.module.fail_json(msg=', '.join(msg))
self.module.fail_json(msg=to_native(error))
# Fallback print body, if it cant be decoded
self.module.fail_json(msg=to_native(info['body']))
body = response.read()
if body:
return json.loads(to_text(body, errors='surrogate_or_strict'))
return {}
def post(self, url, data, content_type='application/json', additional_headers=None):
return self.request(url, data=data, method='POST', content_type=content_type,
additional_headers=additional_headers)
def put(self, url, data):
return self.request(url, data=data, method='PUT')
def get(self, url):
return self.request(url)
2020-03-09 10:11:07 +01:00
def main():
jira = JIRA()
jira.run()
2020-03-09 10:11:07 +01:00
if __name__ == '__main__':
main()