2021-04-07 08:14:03 +02:00
|
|
|
---
|
2022-08-05 14:03:38 +02:00
|
|
|
# Copyright (c) Ansible Project
|
|
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-04-26 13:09:19 +02:00
|
|
|
- name: create test ticket
|
|
|
|
community.general.jira:
|
2021-04-07 08:14:03 +02:00
|
|
|
uri: "{{ uri }}"
|
|
|
|
username: "{{ user }}"
|
|
|
|
password: "{{ pasw }}"
|
|
|
|
project: "{{ proj }}"
|
|
|
|
operation: create
|
|
|
|
summary: test ticket
|
|
|
|
description: bla bla bla
|
|
|
|
issuetype: Task
|
|
|
|
register: issue
|
|
|
|
- debug:
|
|
|
|
msg: Issue={{ issue }}
|
2021-04-26 13:09:19 +02:00
|
|
|
- name: assert test ticket
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- issue is changed
|
|
|
|
- issue.meta.key.startswith(proj)
|
|
|
|
|
|
|
|
- name: add comment bleep bleep
|
2021-04-07 08:14:03 +02:00
|
|
|
community.general.jira:
|
|
|
|
uri: "{{ uri }}"
|
|
|
|
username: "{{ user }}"
|
|
|
|
password: "{{ pasw }}"
|
|
|
|
issue: "{{ issue.meta.key }}"
|
|
|
|
operation: comment
|
|
|
|
comment: bleep bleep!
|
2021-04-26 13:09:19 +02:00
|
|
|
register: comment_bleep_bleep
|
|
|
|
- name: assert comment bleep bleep
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- comment_bleep_bleep is changed
|
|
|
|
- comment_bleep_bleep.meta.body == "bleep bleep!"
|
|
|
|
- comment_bleep_bleep.meta.body != None
|
|
|
|
|
|
|
|
- name: transition -> In Progress with comment
|
2021-04-07 08:14:03 +02:00
|
|
|
community.general.jira:
|
|
|
|
uri: "{{ uri }}"
|
|
|
|
username: "{{ user }}"
|
|
|
|
password: "{{ pasw }}"
|
|
|
|
issue: "{{ issue.meta.key }}"
|
|
|
|
operation: transition
|
|
|
|
status: Start Progress
|
|
|
|
comment: -> in progress
|
2021-04-26 13:09:19 +02:00
|
|
|
register: transition_inprog
|
|
|
|
- name: assert transition -> In Progress with comment
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- transition_inprog is changed
|
|
|
|
|
|
|
|
- name: change assignee
|
2021-04-07 08:14:03 +02:00
|
|
|
community.general.jira:
|
|
|
|
uri: "{{ uri }}"
|
|
|
|
username: "{{ user }}"
|
|
|
|
password: "{{ pasw }}"
|
|
|
|
issue: "{{ issue.meta.key }}"
|
|
|
|
operation: edit
|
2021-04-26 13:09:19 +02:00
|
|
|
account_id: "{{ user2 }}"
|
|
|
|
register: assign
|
|
|
|
- name: assert change assignee
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- assign is changed
|
|
|
|
|
2023-03-26 10:21:49 +02:00
|
|
|
- name: Worklog on issue
|
|
|
|
community.general.jira:
|
|
|
|
uri: '{{ server }}'
|
|
|
|
username: '{{ user }}'
|
|
|
|
password: '{{ pass }}'
|
|
|
|
issue: '{{ issue.meta.key }}'
|
|
|
|
operation: worklog
|
|
|
|
comment: Worklog
|
|
|
|
fields:
|
|
|
|
timeSpentSeconds: 1200
|
|
|
|
register: worklog
|
|
|
|
- name: assert worklog -> with comment
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- worklog is changed
|
|
|
|
- worklog.meta.comment == 'Worklog'
|
|
|
|
- worklog.meta.timeSpentSeconds == 1200
|
|
|
|
|
2021-04-26 13:09:19 +02:00
|
|
|
- name: transition -> Resolved with comment
|
2021-04-07 08:14:03 +02:00
|
|
|
community.general.jira:
|
|
|
|
uri: "{{ uri }}"
|
|
|
|
username: "{{ user }}"
|
|
|
|
password: "{{ pasw }}"
|
|
|
|
issue: "{{ issue.meta.key }}"
|
|
|
|
operation: transition
|
|
|
|
status: Resolve Issue
|
|
|
|
comment: -> resolved
|
2021-04-26 13:09:19 +02:00
|
|
|
account_id: "{{ user1 }}"
|
2021-04-07 08:14:03 +02:00
|
|
|
fields:
|
|
|
|
resolution:
|
|
|
|
name: Done
|
|
|
|
description: wakawakawakawaka
|
2021-04-26 13:09:19 +02:00
|
|
|
register: transition_resolved
|
|
|
|
- name: assert transition -> Resolved with comment
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- transition_resolved is changed
|
2021-04-07 08:14:03 +02:00
|
|
|
|
|
|
|
- debug:
|
|
|
|
msg:
|
|
|
|
- Issue = {{ issue.meta.key }}
|
|
|
|
- URL = {{ issue.meta.self }}
|