Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/jira/tasks/main.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: create test ticket
7 community.general.jira:
8 uri: "{{ uri }}"
9 username: "{{ user }}"
10 password: "{{ pasw }}"
11 project: "{{ proj }}"
12 operation: create
13 summary: test ticket
14 description: bla bla bla
15 issuetype: Task
16 register: issue
17 - debug:
18 msg: Issue={{ issue }}
19 - name: assert test ticket
20 assert:
21 that:
22 - issue is changed
23 - issue.meta.key.startswith(proj)
24
25 - name: add comment bleep bleep
26 community.general.jira:
27 uri: "{{ uri }}"
28 username: "{{ user }}"
29 password: "{{ pasw }}"
30 issue: "{{ issue.meta.key }}"
31 operation: comment
32 comment: bleep bleep!
33 register: comment_bleep_bleep
34 - name: assert comment bleep bleep
35 assert:
36 that:
37 - comment_bleep_bleep is changed
38 - comment_bleep_bleep.meta.body == "bleep bleep!"
39 - comment_bleep_bleep.meta.body != None
40
41 - name: transition -> In Progress with comment
42 community.general.jira:
43 uri: "{{ uri }}"
44 username: "{{ user }}"
45 password: "{{ pasw }}"
46 issue: "{{ issue.meta.key }}"
47 operation: transition
48 status: Start Progress
49 comment: -> in progress
50 register: transition_inprog
51 - name: assert transition -> In Progress with comment
52 assert:
53 that:
54 - transition_inprog is changed
55
56 - name: change assignee
57 community.general.jira:
58 uri: "{{ uri }}"
59 username: "{{ user }}"
60 password: "{{ pasw }}"
61 issue: "{{ issue.meta.key }}"
62 operation: edit
63 account_id: "{{ user2 }}"
64 register: assign
65 - name: assert change assignee
66 assert:
67 that:
68 - assign is changed
69
70 - name: Worklog on issue
71 community.general.jira:
72 uri: '{{ server }}'
73 username: '{{ user }}'
74 password: '{{ pass }}'
75 issue: '{{ issue.meta.key }}'
76 operation: worklog
77 comment: Worklog
78 fields:
79 timeSpentSeconds: 1200
80 register: worklog
81 - name: assert worklog -> with comment
82 assert:
83 that:
84 - worklog is changed
85 - worklog.meta.comment == 'Worklog'
86 - worklog.meta.timeSpentSeconds == 1200
87
88 - name: transition -> Resolved with comment
89 community.general.jira:
90 uri: "{{ uri }}"
91 username: "{{ user }}"
92 password: "{{ pasw }}"
93 issue: "{{ issue.meta.key }}"
94 operation: transition
95 status: Resolve Issue
96 comment: -> resolved
97 account_id: "{{ user1 }}"
98 fields:
99 resolution:
100 name: Done
101 description: wakawakawakawaka
102 register: transition_resolved
103 - name: assert transition -> Resolved with comment
104 assert:
105 that:
106 - transition_resolved is changed
107
108 - debug:
109 msg:
110 - Issue = {{ issue.meta.key }}
111 - URL = {{ issue.meta.self }}