Skip to content

Commit

Permalink
add workflow to create & close jira
Browse files Browse the repository at this point in the history
  • Loading branch information
yesha-fauna committed Dec 13, 2023
1 parent 2732da7 commit e733acd
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/close-jira-ticket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Set JIRA ticket to DONE

on:
issues:
types: [closed, deleted]

jobs:
set_done_for_closed_issued:
name: Set JIRA ticket to DONE
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Find comment with ticket number
uses: peter-evans/find-comment@v1
id: comment
with:
issue-number: ${{ github.event.issue.number }}
body-includes: Internal ticket number is FE-

- name: Get ticket number
id: ticket
uses: atlassian/gajira-find-issue-key@master
with:
string: ${{ steps.comment.outputs.comment-body }}

- name: Close
uses: atlassian/gajira-transition@master
with:
issue: ${{ steps.ticket.outputs.issue }}
transition: 'DONE'
37 changes: 37 additions & 0 deletions .github/workflows/create-jira-ticket-from-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create JIRA ticket for GH issue

on:
issues:
types: [opened]

jobs:
create_ticket_from_issue:
name: Create JIRA ticket
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create
id: create
uses: atlassian/gajira-create@master
with:
project: FE
issuetype: Bug
summary: Issue ${{ github.event.issue.number }} ${{ github.event.issue.title }}
description: ${{ github.event.issue.html_url }}
fields: '{"labels": ["github", "issue", "dx-ops"], "components": [{ "name": "V10 JavaScript Driver" }]}'

- name: Comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: Internal ticket number is ${{ steps.create.outputs.issue }}

- name: Complete
if: ${{ steps.create.outputs.issue }}
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
31 changes: 31 additions & 0 deletions .github/workflows/create-jira-ticket-from-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create JIRA ticket for GH pull request

on:
pull_request:
types: [opened]

jobs:
create_ticket_from_pr:
name: Create JIRA ticket
runs-on: ubuntu-latest
steps:
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create
id: create
uses: atlassian/gajira-create@master
with:
project: FE
issuetype: Task
summary: Pull Request ${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}
description: ${{ github.event.pull_request.html_url }}
fields: '{"labels": ["github", "pr", "dx-ops"], "components": [{ "name": "V10 JavaScript Driver" }]}'

- name: Complete
if: ${{ steps.create.outputs.issue }}
run: echo "Issue ${{ steps.create.outputs.issue }} was created"

0 comments on commit e733acd

Please sign in to comment.