Skip to content

Commit e81cea3

Browse files
Updated jira README.md
I have read the CLA Document and I hereby sign the CLA
1 parent 517f28b commit e81cea3

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

examples/jira/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,61 @@ For detailed technical information about the JIRA helper application, including:
179179

180180
Please refer to the [helper directory README](helper/README.md).
181181

182+
183+
### **How It Works: A Step-by-Step Breakdown**
184+
185+
#### **1\. Build Helper Application**
186+
187+
The workflow begins by setting up Go and compiling the custom `helper/main.go` application. This binary contains all the logic for parsing git commits and interacting with the Jira API.
188+
189+
```
190+
# In directory examples/jira/helper
191+
chmod +x build.sh
192+
./build.sh
193+
```
194+
195+
---
196+
197+
#### **2\. Build and Publish Docker Image**
198+
199+
Next, a sample Docker image is built and pushed to Artifactory. The workflow captures rich build information, including git context and environment variables, using `jf rt build-publish`.
200+
201+
```
202+
# In directory examples/jira
203+
docker build . --file Dockerfile --tag $REGISTRY_DOMAIN/$REPO_NAME/$IMAGE_NAME:$VERSION
204+
docker push $REGISTRY_DOMAIN/$REPO_NAME/$IMAGE_NAME:$VERSION
205+
# ... jf commands to publish build-info
206+
```
207+
208+
---
209+
210+
#### **3\. Extract and Validate Jira Data**
211+
212+
This is the core logic step. The compiled Go helper is executed, using the `start_commit` provided at runtime to define a range of git commits to scan. The application extracts all matching Jira IDs, queries the Jira API for their details, and generates the `transformed_jira_data.json` and optional Markdown report.
213+
214+
```
215+
# In directory examples/jira/helper
216+
./main "${{ github.event.inputs.start_commit }}"
217+
```
218+
219+
---
220+
221+
#### **4\. Attach Signed Evidence to Build**
222+
223+
This final step uses `jf evd create --build-name` to attach the Jira ticket summary to the **build information** that was published in step 2\. This creates a verifiable link between the CI process itself and the project management tickets that authorized the code changes within it.
224+
225+
```
226+
jf evd create \
227+
--build-name $BUILD_NAME \
228+
--build-number ${{ github.run_number }} \
229+
--key "${{ secrets.PRIVATE_KEY }}" \
230+
--key-alias "${{ vars.EVIDENCE_KEY_ALIAS }}" \
231+
--predicate ./examples/jira/helper/transformed_jira_data.json \
232+
--predicate-type http://atlassian.com/jira/issues/v1 \
233+
${{ env.ATTACH_OPTIONAL_CUSTOM_MARKDOWN_TO_EVIDENCE == 'true' && '--markdown "examples/jira/helper/transformed_jira_data.md"' || '' }}
234+
```
235+
236+
182237
## **References**
183238

184239
* [Jira REST API Documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/)

0 commit comments

Comments
 (0)