@@ -24,6 +24,9 @@ alter the Python script itself. Adding a new product involves two steps:
2424. Add the new product release set to `cb_release_notes_config.yaml`.
2525. Create a new Jinja template for rendering the AsciiDoc file for your new release note.
2626
27+
28+ == Adding a new product
29+
2730To demonstrate this process, we're going to create a new release note configuration for the Sync Gateway product.
2831
2932NOTE: You should run the following commands from the directory where your Release Notes Generator is installed.
@@ -91,6 +94,7 @@ release_settings:
9194Now, you add the URL and the JQL statements used to retrieve the Jira tickets that match your parameters:
9295
9396[source, yaml]
97+ .Adding the JQL statement
9498----
9599release_settings:
96100 - name: "Sync Gateway"
@@ -105,17 +109,71 @@ release_settings:
105109 type: file
106110 message: 'Enter the file path for the release notes:'
107111 url: https://jira.issues.couchbase.com
108- jql: project = CBG AND issuetype in (Bug, "New Feature") #<.>
109- AND (fixVersion = {{release_number}} OR labels IN (known_issue)) #<.>
110- ORDER BY key ASC #<.>
112+ jql: project = CBG AND issuetype in (Bug, "New Feature", Improvement) # <.>
113+ AND (fixVersion = {{release_number}} OR labels IN (known_issue)) # <.>
114+ ORDER BY key ASC # <.>
115+ template: sync-gateway.jinja2
111116----
112-
113117<.> Note that the JQL statement restricts the query to tickets belonging to the Sync Gateway project,
114118and also ensures that the ticket is either a Bug or a New Feature.
115119<.> We supply the `release_number` parameter to the JQL statement so that we only pick up tickets from the specified release.
116120<.> The `ORDER BY key` clause ensures that the tickets are returned in ascending order based on their Jira key.
117121This is important to ensure that the tickets are passed to the template in the correct order.
118122
123+ [#define-release-note-field]
124+ === Step {counter: step}: Define the release note field.
125+
126+ The script needs to know which field in a Jira ticket holds the release note description.
127+ The script uses this to ensure that the ticket's release note description field has been filled in.
128+ If the field hasn't been filled in,
129+ the script can optionally use AI to generate a release note summary from the
130+ ticket and comments.
131+ For most of the Couchbase projects, this was added some time after the Jira system was set up,
132+ so the new field was added as a custom field called `customfield_11402`.
133+
134+ [source,yaml, subs="+quotes"]
135+ ----
136+ - name: "Sync Gateway"
137+ fields:
138+ - name: release_number
139+ type: text
140+ message: 'Enter the release number:'
141+ - name: release_date
142+ type: text
143+ message: 'Enter the release date (Month Year):'
144+ - name: file_path
145+ type: file
146+ message: 'Enter the file path for the release notes:'
147+ url: https://jira.issues.couchbase.com
148+ jql: project = CBG AND issuetype in (Bug, "New Feature", Improvement)
149+ AND (fixVersion = {{release_number}} OR labels IN (known_issue))
150+ ORDER BY key ASC
151+ #release_note_field: 'customfield_11402'#
152+ template: sync-gateway.jinja2
153+ ----
154+
155+ Any item from the `fields` list can be designated as a `release_note_field` (e.g. the ticket's `summary` field).
156+ Alternatively, if the project doesn't have a release note field, then set `release_note_field` to `None`.
157+
158+ .Retrieving JIRA field names
159+ ****
160+ The field names for Jira often differ from the names displayed on the ticket's page.
161+
162+ The easiest way to get the field names is to
163+ use the `CURL` and `jq` commands to retrieve an existing ticket with a public security level:
164+
165+ [source,shell, subs="+quotes"]
166+ ----
167+ curl -X GET --location "https://jira.issues.couchbase.com/rest/api/2/issue/CBG-4977" \
168+ -H "Authorization: Basic #<insert your JIRA token here>#" \
169+ -H "Content-Type: application/json" | jq
170+ ----
171+
172+ This will render the complete ticket (including field names) to the standard output.
173+ ****
174+
175+
176+
119177[#define-your-jinja-template]
120178=== Step {counter: step}: Define your JINJA template
121179
@@ -144,7 +202,7 @@ release_settings:
144202 template: sync-gateway.jinja2
145203----
146204
147- Step {counter: step}: Create your JINJA template
205+ === Step {counter: step}: Create your JINJA template
148206
149207The templates reside in the `templates` directory, as defined near the top of the configuration file.
150208Use your editor to create a new template file in this directory. The file should be called `sync-gateway.jinja2`,
0 commit comments