You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Extract create and update issue
* Remove client as action attributes
* Remove useless code
* Extract add comment
* Remove indirection with comments for changes
* Instantiate context in __call__ instead of each method
* Remove usage of self in _update_issue()
* Split default with status and assignee into smaller bits
* Rename create_comment()
* Remove class inheritance between default and default with status and assignee (ref #77) (#233)
* Move helpers to jbi.services.jira and bugzilla
* Move bugzilla out of jira module
* Add type annotations
* Update code comment about bug.comment
* Chain operations instead of using nested conditions (with `:=` operators) (#236)
* Rename ActionLogContext to ActionContext
* Rename log_context to context
* Remove := operator and chain operations
* Remove the maybe_ from services.jira
* Align signatures of action functions
* Do not duplicate parameters between init and call
* Runner now instantiates context
* Pass actions contexts to action tests
* Update actions docs
* Remove redundant parameters
* Adjust parameters between default.py and jira.py
* Inherit JiraContext from Context
* Remove useless and confusing condition
* Replace repetitive calls with list of steps
* Let the runner set the ActionContext operation
* Reintroduce maybe_ for optional steps
* Load default action steps from configuration (#253)
* Move steps to jbi.actions.steps
* Rename test_default to test_steps
* Move test_default_with_assignee_and_status into test_steps
* Load default action steps from configuration
* Add tests for the default action behaviour
* Rename groups of steps. create -> new, update -> existing
* Remove default value config/config.prod.yaml
Co-authored-by: bsieber-mozilla <[email protected]>
* Move remapping of steps into helper
* Remove useless pylint annotation
* Adjust docstrings
* Merge unspecified groups with default ones
* Update secrets baseline
Co-authored-by: bsieber-mozilla <[email protected]>
Co-authored-by: bsieber-mozilla <[email protected]>
Co-authored-by: bsieber-mozilla <[email protected]>
The `jbi.actions.default_with_assignee_and_status` action adds some additional
104
-
features on top of the default.
105
-
106
-
It will attempt to assign the Jira issue the same person as the bug is assigned to. This relies on
107
-
the user using the same email address in both Bugzilla and Jira. If the user does not exist in Jira
108
-
then the assignee is cleared from the Jira issue. The Jira account that JBI uses requires the "Browse
109
-
users and groups" global permission in order to set the assignee.
110
-
111
-
If configured, the action supports setting the Jira issues's status when the Bugzilla status and resolution change.
74
+
It will also set the Jira issue URL in the Bugzilla bug `see_also` field, and add a link
75
+
to the Bugzilla ticket on the Jira issue.
112
76
113
77
**Parameters**
114
78
115
79
- `jira_project_key`
116
80
- string
117
81
- The Jira project identifier
118
-
- `sync_whiteboard_labels`
82
+
- `steps`
83
+
- mapping [str, list[str]]
84
+
- If defined, the specified steps are executed. The group of steps listed under `new` are executed when a Bugzilla event occurs on a ticket that is unknown to Jira. The steps under `existing`, when the Bugzilla ticket is already linked to a Jira issue. The steps under `comment` when a comment is posted on a linked Bugzilla ticket.
85
+
If one of these groups is not specified, the default steps will be used.
86
+
- `sync_whiteboard_labels`(optional)
119
87
- boolean
120
88
- Whether to sync the Bugzilla status whiteboard labels to Jira. Defaults to `true`.
121
89
- `status_map`(optional)
@@ -125,32 +93,88 @@ If configured, the action supports setting the Jira issues's status when the Bug
125
93
- mapping [str, str]
126
94
- If defined, map the Bugzilla bug resolution to Jira issue resolution
In this case if the bug changes to the NEW status the action will attempt to set the linked Jira
147
148
issue status to "In Progress". If the bug changes to RESOLVED FIXED it will attempt to set the
148
149
linked Jira issue status to "Closed". If the bug changes to a status not listed in `status_map` then
149
150
no change will be made to the Jira issue.
151
+
### Available Steps
152
+
153
+
- `create_issue`
154
+
- `maybe_delete_duplicate`
155
+
- `add_link_to_bugzilla`
156
+
- `add_link_to_jira`
157
+
- `maybe_assign_jira_user`:
158
+
It will attempt to assign the Jira issue the same person as the bug is assigned to. This relies on
159
+
the user using the same email address in both Bugzilla and Jira. If the user does not exist in Jira
160
+
then the assignee is cleared from the Jira issue. The Jira account that JBI uses requires the "Browse
161
+
users and groups" global permission in order to set the assignee.
162
+
- `maybe_update_issue_resolution`:
163
+
If the Bugzilla ticket resolution field is specified in the `resolution_map` parameter, it will set the
164
+
Jira issue resolution.
165
+
- `maybe_update_issue_status`:
166
+
If the Bugzilla ticket status field is specified in the `status_map` parameter, it will set the
167
+
Jira issue status.
168
+
- `update_issue`
169
+
- `add_jira_comments_for_changes`
170
+
- `maybe_assign_jira_user`
171
+
- `maybe_update_issue_resolution`
172
+
- `maybe_update_issue_status`
173
+
- `create_comment`
150
174
151
175
### Custom Actions
152
-
If you're looking for a unique capability for your team's data flow, you can add your own Python methods and functionality[...read more here.](jbi/actions/README.md)
153
176
177
+
If you're looking for a unique capability for your team's data flow, you can add your own Python methods and functionality[...read more here.](jbi/actions/README.md)
print(f"{optional_param}, going to {jira_project_key}!")
23
23
returnTrue, {"result": 42}
24
24
@@ -27,11 +27,11 @@ Let's create a `new_action`!
27
27
28
28
1. In the above example the `jira_project_key` parameter is required
29
29
1.`optional_param`, which has a default value, is not required to run this action
30
-
1.`init()` returns a `__call__`able object that the system calls with the Bugzilla bug and WebHook event objects
30
+
1.`init()` returns a `__call__`able object that the system calls with the `ActionContext` object
31
31
1. The returned `ActionResult` features a boolean to indicate whether something was performed or not, along with a `Dict` (used as a response to the WebHook endpoint).
32
32
33
-
1. Use the `bug` and `event` information to perform the desired processing!
34
-
1. List the required Jira permissions to be set on projects that will use this action in the `JIRA_REQUIRED_PERMISSIONS` constant. The list of built-in permissions is [available on Atlanssian API docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions).
33
+
1. Use the `context.bug`, `context.event`, `context.jira` information to perform the desired processing!
34
+
1. List the required Jira permissions to be set on projects that will use this action in the `JIRA_REQUIRED_PERMISSIONS` constant. The list of built-in permissions is [available on Atlassian API docs](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions).
35
35
1. Use the available service calls from `jbi/services` (or make new ones)
36
36
1. Update the `README.md` to document your action
37
37
1. Now the action `jbi.actions.my_team_actions` can be used in the YAML configuration, under the `module` key.
0 commit comments