Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflow to create & close jira #230

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"