GithubHelp home page GithubHelp logo

gajira-transition's Introduction


⚠️ This repository isn’t maintained anymore.

Jira Transition

Transition Jira issue

Only supports Jira Cloud. Does not support Jira Server (hosted)

Usage

Note: this action requires Jira Login Action

Issue Transition

Example transition action:

- name: Transition issue
  id: transition
  uses: atlassian/gajira-transition@v3
  with:
    issue: GA-181
    transition: "In progress"
}

The issue parameter can be an issue id created or retrieved by an upstream action – for example, Create or Find Issue Key. Here is full example workflow:

on:
  push

name: Test Transition Issue

jobs:
  test-transition-issue:
    name: Transition Issue
    runs-on: ubuntu-latest
    steps:
    - name: Login
      uses: atlassian/gajira-login@v3
      env:
        JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
        JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
        JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
        
    - name: Create new issue
      id: create
      uses: atlassian/gajira-create@v3

    - name: Transition issue
      uses: atlassian/gajira-transition@v3
      with:
        issue: ${{ steps.create.outputs.issue }}
        transition: "In progress"

Action Spec:

Environment variables

  • None

Inputs

  • issue (required) - issue key to perform a transition on
  • transition - Case insensetive name of transition to apply. Example: Cancel or Accept
  • transitionId - transition id to apply to an issue

Outputs

  • None

Reads fields from config file at $HOME/jira/config.yml

  • issue
  • transitionId

Writes fields to config file at $HOME/jira/config.yml

  • None

gajira-transition's People

Contributors

drudzikatlassian avatar imjohnbo avatar joshkay10 avatar mboudreau avatar rudzon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gajira-transition's Issues

Add support for issue resolution

Hi,

Our Jira setup requires a Resolution ("Done", "Won't Fix", etc.) when closing an issue, but there doesn't seem to be a way to set that via this GH Action.

Bad Request while tring to transition an issue.

I'm having trouble transitioning an issue to the next phase. I'm new to GitHub Actions, so maybe it's something totally obvious, but it doesn't say whats wrong in the output.

2019-09-18T11:02:55.1725704Z Current runner version: '2.157.5'
2019-09-18T11:02:55.1747369Z Prepare workflow directory
2019-09-18T11:02:55.3090229Z Prepare all required actions
2019-09-18T11:02:55.3425511Z Download action repository 'atlassian/gajira-login@master'
2019-09-18T11:02:57.1301137Z Download action repository 'atlassian/gajira-find-issue-key@master'
2019-09-18T11:02:58.2332945Z Download action repository 'atlassian/gajira-transition@master'
2019-09-18T11:02:58.7112283Z ##[group]Run atlassian/gajira-login@master
2019-09-18T11:02:58.7188224Z env:
2019-09-18T11:02:58.7188815Z   JIRA_BASE_URL: ***
2019-09-18T11:02:58.7189084Z   JIRA_USER_EMAIL: ***
2019-09-18T11:02:58.7189269Z   JIRA_API_TOKEN: ***
2019-09-18T11:02:58.7189437Z ##[endgroup]
2019-09-18T11:03:01.5925855Z Logged in as: paales
2019-09-18T11:03:01.6353962Z ##[group]Run atlassian/gajira-find-issue-key@master
2019-09-18T11:03:01.6354173Z with:
2019-09-18T11:03:01.6354294Z   from: commits
2019-09-18T11:03:01.6354446Z ##[endgroup]
2019-09-18T11:03:02.2769469Z Detected issueKey: MT-1394
2019-09-18T11:03:02.2770292Z Saving MT-1394 to /home/runner/.jira.d/config.yml
2019-09-18T11:03:02.2770953Z Saving MT-1394 to /home/runner/jira/config.yml
2019-09-18T11:03:02.2904651Z ##[set-output name=issue;]MT-1394
2019-09-18T11:03:02.3007222Z ##[group]Run atlassian/gajira-transition@master
2019-09-18T11:03:02.3007416Z with:
2019-09-18T11:03:02.3007931Z   issue: MT-1394
2019-09-18T11:03:02.3008155Z   transition: Needs approval RC
2019-09-18T11:03:02.3008322Z ##[endgroup]
2019-09-18T11:03:03.2279846Z Error: Jira API error
2019-09-18T11:03:03.2280078Z Selected transition:{
2019-09-18T11:03:03.2301362Z     at Jira.fetch (/home/runner/work/_actions/atlassian/gajira-transition/master/dist/index.js:1:63222)
2019-09-18T11:03:03.2301681Z     "id": "361",
2019-09-18T11:03:03.2302232Z     at processTicksAndRejections (internal/process/task_queues.js:89:5) {
2019-09-18T11:03:03.2302441Z     "name": "Needs approval RC",
2019-09-18T11:03:03.2302778Z   req: {
2019-09-18T11:03:03.2302941Z     "to": {
2019-09-18T11:03:03.2303528Z     method: 'POST',
2019-09-18T11:03:03.2303898Z         "self": "***rest/api/2/status/10735",
2019-09-18T11:03:03.2304083Z         "description": "",
2019-09-18T11:03:03.2304368Z         "iconUrl": "***images/icons/statuses/generic.png",
2019-09-18T11:03:03.2304570Z         "name": "On RC",
2019-09-18T11:03:03.2304732Z         "id": "10735",
2019-09-18T11:03:03.2304894Z         "statusCategory": {
2019-09-18T11:03:03.2305443Z             "self": "***rest/api/2/statuscategory/3",
2019-09-18T11:03:03.2305776Z             "id": 3,
2019-09-18T11:03:03.2305954Z             "key": "done",
2019-09-18T11:03:03.2306102Z             "colorName": "green",
2019-09-18T11:03:03.2306254Z             "name": "Done"
2019-09-18T11:03:03.2306390Z         }
2019-09-18T11:03:03.2306839Z     },
2019-09-18T11:03:03.2306965Z     "hasScreen": true,
2019-09-18T11:03:03.2307096Z     "isGlobal": false,
2019-09-18T11:03:03.2307230Z     "isInitial": false,
2019-09-18T11:03:03.2308457Z     "isConditional": true
2019-09-18T11:03:03.2308667Z }
2019-09-18T11:03:03.2309170Z     body: '{"transition":{"id":"361"}}',
2019-09-18T11:03:03.2309663Z     url: '***/rest/api/3/issue/MT-1394/transitions'
2019-09-18T11:03:03.2309863Z   },
2019-09-18T11:03:03.2310030Z   res: {
2019-09-18T11:03:03.2310242Z     headers: [Object: null prototype] {
2019-09-18T11:03:03.2310422Z       server: [Array],
2019-09-18T11:03:03.2312779Z       'cache-control': [Array],
2019-09-18T11:03:03.2313163Z       'content-type': [Array],
2019-09-18T11:03:03.2313729Z       'strict-transport-security': [Array],
2019-09-18T11:03:03.2313923Z       date: [Array],
2019-09-18T11:03:03.2314515Z       'atl-traceid': [Array],
2019-09-18T11:03:03.2315108Z       'x-aaccountid': [Array],
2019-09-18T11:03:03.2315475Z       'x-arequestid': [Array],
2019-09-18T11:03:03.2316005Z       'x-xss-protection': [Array],
2019-09-18T11:03:03.2316360Z       'transfer-encoding': [Array],
2019-09-18T11:03:03.2316732Z       'timing-allow-origin': [Array],
2019-09-18T11:03:03.2317258Z       'x-content-type-options': [Array],
2019-09-18T11:03:03.2318421Z       connection: [Array],
2019-09-18T11:03:03.2318894Z       'set-cookie': [Array]
2019-09-18T11:03:03.2319066Z     },
2019-09-18T11:03:03.2319221Z     status: 400,
2019-09-18T11:03:03.2319412Z     body: { errorMessages: [Array], errors: {} }
2019-09-18T11:03:03.2319591Z   },
2019-09-18T11:03:03.2319753Z   originError: Error: Bad Request
2019-09-18T11:03:03.2320228Z       at /home/runner/work/_actions/atlassian/gajira-transition/master/dist/index.js:1:57166
2019-09-18T11:03:03.2320527Z       at processTicksAndRejections (internal/process/task_queues.js:89:5)
2019-09-18T11:03:03.2321053Z       at async Jira.fetch (/home/runner/work/_actions/atlassian/gajira-transition/master/dist/index.js:1:63111)
2019-09-18T11:03:03.2321866Z       at async e.exports.execute (/home/runner/work/_actions/atlassian/gajira-transition/master/dist/index.js:1:185856)
2019-09-18T11:03:03.2322291Z       at async exec (/home/runner/work/_actions/atlassian/gajira-transition/master/dist/index.js:1:7099),
2019-09-18T11:03:03.2322611Z   source: 'jira'
2019-09-18T11:03:03.2322749Z }
2019-09-18T11:03:03.2355609Z ##[error]Node run failed with exit code 1
2019-09-18T11:03:03.2470099Z Cleaning up orphan processes

Breaks .jira.d/config.yml

This writes a {} to the last line of .jira.d/config.yml, which breaks any further actions that attempt to read that file, as it is invalid YAML.

Transition multiple issues

When we are creating a release, we go though commits since last release and we want to transition multiple JIRA issues to "Developed" state. This action allows us to transition only one issue.

Do not fail when issue is already in the state It is being transitioned to

Currently if an issue is already in a state "Development", And if we are trying to transition the issue to the "Development" state again, It is failing.

This is becoming an issue when multiple commits are pushed to a branch.

  • When first commit is pushed, Issue is transitioned to development state
  • When the next commit is pushed, It is trying to do the transition again to "Development" and the workflow is failing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.