@@ -107,6 +107,65 @@ storing any extra information. The label is constructed using
107107"jira_label_prefix" configuration, "jira_issue" from the prerequisite and
108108"jira_label_suffix" template variable originating from the Product pages input.
109109
110+ ### Rule to Assign and Comment on a Jira Issue
111+
112+ The ` jira ` template variable provides access to the Jira client, which can be
113+ used to assign issues to the ReTaSC bot account. Additionally, the ` comment `
114+ field allows adding comments to Jira issues (duplicate comments are
115+ automatically skipped):
116+
117+ ``` yaml
118+ name : New Release Handoff
119+ inputs :
120+ - product : rhel
121+ prerequisites :
122+ - schedule_task : " GA"
123+ - target_date : " start_date - 8|weeks"
124+
125+ - jira_issue : release-handoff
126+ template : " rhel/release-handoff.yml.j2"
127+ fields :
128+ # Assign the issue to the ReTaSC bot account
129+ assignee :
130+ key : " {{ jira.current_user_key }}"
131+ # Add a comment when the issue is created or updated
132+ comment : " This issue was created by ReTaSC for {{ release }}."
133+ ` ` `
134+
135+ ### Rule to Transition Jira Issue Status
136+
137+ The ` status` field allows transitioning a Jira issue to a desired status. When
138+ the target status is not directly reachable, use `transitions` to specify
139+ intermediate statuses to try :
140+
141+ ` ` ` yaml
142+ name: Close Completed Release Tasks
143+ inputs:
144+ - product: rhel
145+ prerequisites:
146+ - schedule_task: "GA"
147+ - target_date: "end_date + 1|week"
148+
149+ - jira_issue: release-task
150+ template: "rhel/release-task.yml.j2"
151+ # Transition the issue to "Closed" status
152+ status: "Closed"
153+ # If "Closed" is not directly reachable, try these intermediate
154+ # statuses in order
155+ transitions:
156+ - New
157+ - In Progress
158+ - Review
159+ - Resolved
160+ - Closed
161+ ` ` `
162+
163+ At each step, ReTaSC first attempts a direct transition to the target status.
164+ If that is not available, it picks the latest (rightmost) status from the
165+ remaining intermediates that is available as a Jira transition, executes it,
166+ and repeats. Entries at or before the issue's current status are skipped
167+ automatically.
168+
110169# ## Rule to Create a Jira Issue on a Fixed Date
111170
112171The following rule will create a Jira 2 weeks before a target date :
@@ -243,6 +302,8 @@ Template variables:
243302- ` report.result` - result from the last `condition` prerequisite
244303- ` today` - today's date in UTC (Python `date` object)
245304- ` rule_file` - current rule file path
305+ - ` jira` - Jira client object; provides `jira.current_user_key` for assigning
306+ issues to the ReTaSC bot account
246307- ` jira_issues` - dict of managed Jira issues; key is Jira issue ID
247308- ` jira_template_file` - Jira issue template path, available only in Jira
248309 template prerequisites
0 commit comments