Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:29:01+00:00 2026-06-11T14:29:01+00:00

How to mark a JIRA issue as resolved or closed via its REST API

  • 0

How to mark a JIRA issue as resolved or closed via its REST API (version 2) using Python?

I found the documentation at http://docs.atlassian.com/jira/REST/latest/#id199544 but I had various errors including:

  • HTTP Error 415: Unsupported Media Type
  • HTTP Error 400
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:29:02+00:00Added an answer on June 11, 2026 at 2:29 pm

    After search for a long time I found the solution, which I’m posting here for anyone else who’s interested in making a Git/Gerrit hook to do such thing like me:

    First open http://example.com/rest/api/2/issue/<ISSUE>/transitions?expand=transitions.fields in your browser for your website and issue number to find the transition ID.

    Supposing it’s 1000:

    import urllib
    import urllib2
    import base64
    import json
    
    key = 'JIRA-123'
    comment = "It's done!"
    username = 'username'
    password = 'password'
    
    # See http://docs.atlassian.com/jira/REST/latest/#id199544
    url = 'http://example.com/rest/api/2/issue/%s/transitions' % key
    auth = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')
    data = json.dumps({
        'transition': {
            'id': 1000    # Resolved (for my setup)
        },
        'update': {
            'comment': [
                {
                    'add': {
                        'body': comment
                    }
                }
            ]
        },
    })
    request = urllib2.Request(url, data, {
        'Authorization': 'Basic %s' % auth,
        'Content-Type': 'application/json',
    })
    print urllib2.urlopen(request).read()
    

    You can completely omit the comment section if you don’t wish to add a comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking at Mark Murphy's excellent example at http://github.com/commonsguy/cw-advandroid/tree/master/Views/ColorMixer/ you can see where he's defined
In our Jira (v4.4) we are using Greenhopper (v5.7.4), as such Greenhopper makes use
I want to mark checkboxes if they have been selected via existing data from
When using Mark Murphy's MergeAdapter everything compiles fine, but when the ListView binding occurs
I mark releases with hg tag <version-number> . When I release a bugfix, I
I'd like to mark a method as deprecated, so the people using it can
is it possible to mark and un mark static table cell via xcode interface
#pragma mark Internal API I've seen this in a book called xcode_quick_tour_iphoneOS. Does someone
I'm using Mark Smith's Julmar MVVM-Helpers library in an application and would like to
I've been using Mark Russinovich's VMMap to map out the Virtual Memory for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.