�
�Udac @` s) d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l m Z m Z d d l m Z d Z y* d d l m Z d d l m Z e Z Wn# e k
r� e
j � Z e Z n Xe d � Z d � Z e! d k r%e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys2
---
module: taiga_issue
short_description: Creates/deletes an issue in a Taiga Project Management Platform
description:
- Creates/deletes an issue in a Taiga Project Management Platform (U(https://taiga.io)).
- An issue is identified by the combination of project, issue subject and issue type.
- This module implements the creation or deletion of issues (not the update).
version_added: "2.0"
options:
taiga_host:
description:
- The hostname of the Taiga instance.
default: https://api.taiga.io
project:
description:
- Name of the project containing the issue. Must exist previously.
required: True
subject:
description:
- The issue subject.
required: True
issue_type:
description:
- The issue type. Must exist previously.
required: True
priority:
description:
- The issue priority. Must exist previously.
default: Normal
status:
description:
- The issue status. Must exist previously.
default: New
severity:
description:
- The issue severity. Must exist previously.
default: Normal
description:
description:
- The issue description.
default: ""
attachment:
description:
- Path to a file to be attached to the issue.
attachment_description:
description:
- A string describing the file to be attached to the issue.
default: ""
tags:
description:
- A lists of tags to be assigned to the issue.
default: []
state:
description:
- Whether the issue should be present or not.
choices: ["present", "absent"]
default: present
author: Alejandro Guirao (@lekum)
requirements: [python-taiga]
notes:
- The authentication is achieved either by the environment variable TAIGA_TOKEN or by the pair of environment variables TAIGA_USERNAME and TAIGA_PASSWORD
s�
# Create an issue in the my hosted Taiga environment and attach an error log
- taiga_issue:
taiga_host: https://mytaigahost.example.com
project: myproject
subject: An error has been found
issue_type: Bug
priority: High
status: New
severity: Important
description: An error has been found. Please check the attached error log for details.
attachment: /path/to/error.log
attachment_description: Error log file
tags:
- Error
- Needs manual check
state: present
# Deletes the previously created issue
- taiga_issue:
taiga_host: https://mytaigahost.example.com
project: myproject
subject: An error has been found
issue_type: Bug
state: absent
s # N( t getenv( t isfile( t
AnsibleModulet missing_required_lib( t to_native( t TaigaAPI( t TaigaExceptionc $
` s% t } y�t d � } | r3 t d | d | � } n_ t d | � } t d � } t d � } t | | g � s| t | d i f S| j d | d | � | j � j } t � f d � | j j d
| � � } t
| � d k r� t | d � i f S| d
} | j } t � f d � | j j d | � � } t
| � d k rTt | d � � f i f S| d
j } t � f d � | j j d | � � } t
| � d k r�t | d � � f i f S| d
j } t � f d � | j
� � } t
| � d k rt | d � � f i f S| d
j � t � f d � | j � � } t
| � d k rbt | d � � f i f S| d
j } i � d 6� d 6� d 6� d 6� d 6� d 6| d 6| d 6} t � � f d � | j � � } t
| � } | d
k r{| d k rht } |
sX| j � | | � | d | d | �}! | rX|! j | d |
�| | d <|
| d! <qXn t | d"