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

545 lines
15 KiB
Python
Raw Normal View History

2020-03-09 10:11:07 +01:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Steve Smith <ssmith@atlassian.com>
# Atlassian open-source approval reference OSR-76.
#
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
# (c) 2020, Per Abildgaard Toft <per@minfejl.dk> Search and update function
#
2020-03-09 10:11:07 +01:00
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
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
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 ]
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
choices: [ 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
required: true
description:
- The username to log-in with.
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
required: true
description:
- The password to log-in with.
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.
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.
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.
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:
- The desired status; only relevant for the transition operation.
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 assignee on create or transition operations. Note not all transitions will allow this.
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.
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 `false` if you'd like to use self-signed certificates)
default: true
type: bool
notes:
- "Currently this only works with basic-auth."
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)"
"""
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
# 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 by target status
- name: Close 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: Done
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_14321: [ {'set': {'value': 'Value of Select' }} ]
comment: [ { 'add': { 'body' : 'Test' } }]
2020-03-09 10:11:07 +01:00
"""
import base64
import json
import sys
from ansible.module_utils.six.moves.urllib.request import pathname2url
from ansible.module_utils._text import to_text, to_bytes, to_native
2020-03-09 10:11:07 +01:00
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url
def request(url, user, passwd, timeout, data=None, method=None):
if data:
data = json.dumps(data)
# 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 basic-auth header up-front to ensure that JIRA treats
# the requests as authorized for this user.
auth = to_text(base64.b64encode(to_bytes('{0}:{1}'.format(user, passwd), errors='surrogate_or_strict')))
response, info = fetch_url(module, url, data=data, method=method, timeout=timeout,
headers={'Content-Type': 'application/json',
'Authorization': "Basic %s" % auth})
if info['status'] not in (200, 201, 204):
error = None
try:
error = json.loads(info['body'])
except Exception:
module.fail_json(msg=to_native(info['body']))
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
if error:
msg = []
for key in ('errorMessages', 'errors'):
if error.get(key):
msg.append(to_native(error[key]))
if msg:
module.fail_json(msg=', '.join(msg))
module.fail_json(msg=to_native(error))
# Fallback print body, if it cant be decoded
module.fail_json(msg=to_native(info['body']))
2020-03-09 10:11:07 +01:00
body = response.read()
if body:
return json.loads(to_text(body, errors='surrogate_or_strict'))
return {}
2020-03-09 10:11:07 +01:00
def post(url, user, passwd, timeout, data):
return request(url, user, passwd, timeout, data=data, method='POST')
def put(url, user, passwd, timeout, data):
return request(url, user, passwd, timeout, data=data, method='PUT')
def get(url, user, passwd, timeout):
return request(url, user, passwd, timeout)
def create(restbase, user, passwd, params):
createfields = {
'project': {'key': params['project']},
'summary': params['summary'],
'issuetype': {'name': params['issuetype']}}
if params['description']:
createfields['description'] = params['description']
# Merge in any additional or overridden fields
if params['fields']:
createfields.update(params['fields'])
data = {'fields': createfields}
url = restbase + '/issue/'
return post(url, user, passwd, params['timeout'], data)
2020-03-09 10:11:07 +01:00
def comment(restbase, user, passwd, params):
data = {
'body': params['comment']
}
url = restbase + '/issue/' + params['issue'] + '/comment'
return post(url, user, passwd, params['timeout'], data)
2020-03-09 10:11:07 +01:00
def edit(restbase, user, passwd, params):
data = {
'fields': params['fields']
}
url = restbase + '/issue/' + params['issue']
return put(url, user, passwd, params['timeout'], data)
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
def update(restbase, user, passwd, params):
data = {
"update": params['fields'],
}
url = restbase + '/issue/' + params['issue']
return put(url, user, passwd, params['timeout'], data)
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
def fetch(restbase, user, passwd, params):
url = restbase + '/issue/' + params['issue']
ret = get(url, user, passwd, params['timeout'])
return ret
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
def search(restbase, user, passwd, params):
url = restbase + '/search?jql=' + pathname2url(params['jql'])
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
if params['fields']:
fields = params['fields'].keys()
url = url + '&fields=' + '&fields='.join([pathname2url(f) for f in fields])
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
if params['maxresults']:
url = url + '&maxResults=' + str(params['maxresults'])
return get(url, user, passwd, params['timeout'])
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
def transition(restbase, user, passwd, params):
# Find the transition id
turl = restbase + '/issue/' + params['issue'] + "/transitions"
tmeta = get(turl, user, passwd, params['timeout'])
target = params['status']
tid = None
for t in tmeta['transitions']:
if t['name'] == target:
tid = t['id']
break
if not tid:
raise ValueError("Failed find valid transition for '%s'" % target)
# Perform it
url = restbase + '/issue/' + params['issue'] + "/transitions"
data = {'transition': {"id": tid},
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
'update': params['fields']}
2020-03-09 10:11:07 +01:00
return post(url, user, passwd, params['timeout'], data)
2020-03-09 10:11:07 +01:00
def link(restbase, user, passwd, params):
data = {
'type': {'name': params['linktype']},
'inwardIssue': {'key': params['inwardissue']},
'outwardIssue': {'key': params['outwardissue']},
}
url = restbase + '/issueLink/'
return post(url, user, passwd, params['timeout'], data)
2020-03-09 10:11:07 +01:00
# Some parameters are required depending on the operation:
OP_REQUIRED = dict(create=['project', 'issuetype', 'summary'],
comment=['issue', 'comment'],
edit=[],
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
update=[],
2020-03-09 10:11:07 +01:00
fetch=['issue'],
transition=['status'],
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
link=['linktype', 'inwardissue', 'outwardissue'],
search=['jql'])
2020-03-09 10:11:07 +01:00
def main():
global module
module = AnsibleModule(
argument_spec=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
uri=dict(type='str', required=True),
operation=dict(type='str', choices=['create', 'comment', 'edit', 'update', 'fetch', 'transition', 'link', 'search'],
2020-03-09 10:11:07 +01:00
aliases=['command'], 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
username=dict(type='str', required=True),
password=dict(type='str', required=True, no_log=True),
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', ),
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'),
),
supports_check_mode=False
)
op = module.params['operation']
# Check we have the necessary per-operation parameters
missing = []
for parm in OP_REQUIRED[op]:
if not module.params[parm]:
missing.append(parm)
if missing:
module.fail_json(msg="Operation %s require the following missing parameters: %s" % (op, ",".join(missing)))
# Handle rest of parameters
uri = module.params['uri']
user = module.params['username']
passwd = module.params['password']
if module.params['assignee']:
module.params['fields']['assignee'] = {'name': module.params['assignee']}
if not uri.endswith('/'):
uri = uri + '/'
restbase = uri + 'rest/api/2'
# Dispatch
try:
# Lookup the corresponding method for this operation. This is
# safe as the AnsibleModule should remove any unknown operations.
thismod = sys.modules[__name__]
method = getattr(thismod, op)
ret = method(restbase, user, passwd, module.params)
except Exception as e:
return module.fail_json(msg=to_native(e))
2020-03-09 10:11:07 +01:00
module.exit_json(changed=True, meta=ret)
if __name__ == '__main__':
main()