Giter VIP home page Giter VIP logo

jira-ruby's Introduction

JIRA API Gem

Code Climate Build Status

This gem provides access to the Atlassian JIRA REST API.

Example usage

Jira Ruby API - Sample Usage

This sample usage demonstrates how you can interact with JIRA's API using the jira-ruby gem.

Dependencies

Before running, install the jira-ruby gem:

gem install jira-ruby

Sample Usage

Connect to JIRA Firstly, establish a connection with your JIRA instance by providing a few configuration parameters: There are other ways to connect to JIRA listed below | Personal Access Token

  • private_key_file: The path to your RSA private key file.
  • consumer_key: Your consumer key.
  • site: The URL of your JIRA instance.
options = {
  :private_key_file => "rsakey.pem",
  :context_path     => '',
  :consumer_key     => 'your_consumer_key',
  :site             => 'your_jira_instance_url'
}

client = JIRA::Client.new(options)

Retrieve and Display Projects

After establishing the connection, you can fetch all projects and display their key and name:

projects = client.Project.all

projects.each do |project|
  puts "Project -> key: #{project.key}, name: #{project.name}"
end

Handling Fields by Name

The jira-ruby gem allows you to refer to fields by their custom names rather than identifiers. Make sure to map fields before using them:

client.Field.map_fields

old_way = issue.customfield_12345

# Note: The methods mapped here adopt a unique style combining PascalCase and snake_case conventions.
new_way = issue.Special_Field

JQL Queries

To find issues based on specific criteria, you can use JIRA Query Language (JQL):

client.Issue.jql(a_normal_jql_search, fields:[:description, :summary, :Special_field, :created])

Several actions can be performed on the Issue object such as create, update, transition, delete, etc:

Creating an Issue

issue = client.Issue.build
labels = ['label1', 'label2']
issue.save({
  "fields" => {
    "summary" => "blarg from in example.rb",
    "project" => {"key" => "SAMPLEPROJECT"},
    "issuetype" => {"id" => "3"},
    "labels" => labels,
    "priority" => {"id" => "1"}
  }
})

Updating/Transitioning an Issue

issue = client.Issue.find("10002")
issue.save({"fields"=>{"summary"=>"EVEN MOOOOOOARRR NINJAAAA!"}})

issue_transition = issue.transitions.build
issue_transition.save!('transition' => {'id' => transition_id})

Deleting an Issue

issue = client.Issue.find('SAMPLEPROJECT-2')
issue.delete

Other Capabilities

Apart from the operations listed above, this API wrapper supports several other capabilities like: • Searching for a user • Retrieving an issue's watchers • Changing the assignee of an issue • Adding attachments and comments to issues • Managing issue links and much more.

Not all examples are shown in this README; refer to the complete script example for a full overview of the capabilities supported by this API wrapper.

Links to JIRA REST API documentation

Running tests

Before running tests, you will need a public certificate generated.

rake jira:generate_public_cert

Setting up the JIRA SDK

On Mac OS,

./bin/atlas-run-standalone --product jira

Once this is running, you should be able to connect to http://localhost:2990/ and login to the JIRA admin system using admin:admin

You'll need to create a dummy project and probably some issues to test using this library.

Configuring JIRA to use OAuth

From the JIRA API tutorial

The first step is to register a new consumer in JIRA. This is done through the Application Links administration screens in JIRA. Create a new Application Link. Administration/Plugins/Application Links

When creating the Application Link use a placeholder URL or the correct URL to your client (e.g. http://localhost:3000), if your client can be reached via HTTP and choose the Generic Application type. After this Application Link has been created, edit the configuration and go to the incoming authentication configuration screen and select OAuth. Enter in this the public key and the consumer key which your client will use when making requests to JIRA.

This public key and consumer key will need to be generated by the Gem user, using OpenSSL or similar to generate the public key and the provided rake task to generate the consumer key.

After you have entered all the information click OK and ensure OAuth authentication is enabled.

For two legged oauth in server mode only, not in cloud based JIRA, make sure to Allow 2-Legged OAuth

Configuring JIRA to use HTTP Basic Auth

Follow the same steps described above to set up a new Application Link in JIRA, however there is no need to set up any "incoming authentication" as this defaults to HTTP Basic Auth.

Configuring JIRA to use Cookie-Based Auth

Jira supports cookie based authentication whereby user credentials are passed to JIRA via a JIRA REST API call. This call returns a session cookie which must then be sent to all following JIRA REST API calls.

To enable cookie based authentication, set :auth_type to :cookie, set :use_cookies to true and set :username and :password accordingly.

require 'jira-ruby'

options = {
  :username           => 'username',
  :password           => 'pass1234',
  :site               => 'http://mydomain.atlassian.net:443/',
  :context_path       => '',
  :auth_type          => :cookie,  # Set cookie based authentication
  :use_cookies        => true,     # Send cookies with each request
  :additional_cookies => ['AUTH=vV7uzixt0SScJKg7'] # Optional cookies to send
                                                   # with each request
}

client = JIRA::Client.new(options)

project = client.Project.find('SAMPLEPROJECT')

project.issues.each do |issue|
  puts "#{issue.id} - #{issue.summary}"
end

Some authentication schemes might require additional cookies to be sent with each request. Cookies added to the :additional_cookies option will be added to each request. This option should be an array of strings representing each cookie to add to the request.

Some authentication schemes that require additional cookies ignore the username and password sent in the JIRA REST API call. For those use cases, :username and :password may be omitted from options.

Configuring JIRA to use Personal Access Tokens Auth

If your JIRA system is configured to support Personal Access Token authorization, minor modifications are needed in how credentials are communicated to the server. Specifically, the paremeters :username and :password are not needed. Also, the parameter :default_headers is needed to contain the api_token, which can be obtained following the official documentation from Atlassian. Please note that the Personal Access Token can only be used as it is. If it is encoded (with base64 or any other encoding method) then the token will not work correctly and authentication will fail.

require 'jira-ruby'

# NOTE: the token should not be encoded
api_token = API_TOKEN_OBTAINED_FROM_JIRA_UI

options = {
  :site               => 'http://mydomain.atlassian.net:443/',
  :context_path       => '',
  :username           => '<the email you sign-in to Jira>',
  :password           => api_token,
  :auth_type          => :basic
}

client = JIRA::Client.new(options)

project = client.Project.find('SAMPLEPROJECT')

project.issues.each do |issue|
  puts "#{issue.id} - #{issue.summary}"
end

Using the API Gem in a command line application

Using HTTP Basic Authentication, configure and connect a client to your instance of JIRA.

Note: If your Jira install is hosted on atlassian.net, it will have no context path by default. If you're having issues connecting, try setting context_path to an empty string in the options hash.

require 'rubygems'
require 'pp'
require 'jira-ruby'

# Consider the use of :use_ssl and :ssl_verify_mode options if running locally
# for tests.

# NOTE basic auth no longer works with Jira, you must generate an API token, to do so you must have jira instance access rights. You can generate a token here: https://id.atlassian.com/manage/api-tokens

# You will see JIRA::HTTPError (JIRA::HTTPError) if you attempt to use basic auth with your user's password

username = "myremoteuser"
api_token = "myApiToken"

options = {
            :username => username,
            :password => api_token,
            :site     => 'http://localhost:8080/', # or 'https://<your_subdomain>.atlassian.net/'
            :context_path => '/myjira', # often blank
            :auth_type => :basic,
            :read_timeout => 120
          }

client = JIRA::Client.new(options)

# Show all projects
projects = client.Project.all

projects.each do |project|
  puts "Project -> key: #{project.key}, name: #{project.name}"
end

Using the API Gem in your Rails application

Using oauth, the gem requires the consumer key and public certificate file (which are generated in their respective rake tasks) to initialize an access token for using the JIRA API.

Note that currently the rake task which generates the public certificate requires OpenSSL to be installed on the machine.

Below is an example for setting up a rails application for OAuth authorization.

Ensure the JIRA gem is loaded correctly

# Gemfile
...
gem 'jira-ruby', :require => 'jira-ruby'
...

Add common methods to your application controller and ensure access token errors are handled gracefully

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  protect_from_forgery

  rescue_from JIRA::OauthClient::UninitializedAccessTokenError do
    redirect_to new_jira_session_url
  end

  private

  def get_jira_client

    # add any extra configuration options for your instance of JIRA,
    # e.g. :use_ssl, :ssl_verify_mode, :context_path, :site
    options = {
      :private_key_file => "rsakey.pem",
      :consumer_key => 'test'
    }

    @jira_client = JIRA::Client.new(options)

    # Add AccessToken if authorised previously.
    if session[:jira_auth]
      @jira_client.set_access_token(
        session[:jira_auth]['access_token'],
        session[:jira_auth]['access_key']
      )
    end
  end
end

Create a controller for handling the OAuth conversation.

# app/controllers/jira_sessions_controller.rb
class JiraSessionsController < ApplicationController

  before_filter :get_jira_client

  def new
    callback_url = 'http://callback'
    request_token = @jira_client.request_token(oauth_callback: callback_url)
    session[:request_token] = request_token.token
    session[:request_secret] = request_token.secret

    redirect_to request_token.authorize_url
  end

  def authorize
    request_token = @jira_client.set_request_token(
      session[:request_token], session[:request_secret]
    )
    access_token = @jira_client.init_access_token(
      :oauth_verifier => params[:oauth_verifier]
    )

    session[:jira_auth] = {
      :access_token => access_token.token,
      :access_key => access_token.secret
    }

    session.delete(:request_token)
    session.delete(:request_secret)

    redirect_to projects_path
  end

  def destroy
    session.data.delete(:jira_auth)
  end
end

Create your own controllers for the JIRA resources you wish to access.

# app/controllers/issues_controller.rb
class IssuesController < ApplicationController
  before_filter :get_jira_client
  def index
    @issues = @jira_client.Issue.all
  end

  def show
    @issue = @jira_client.Issue.find(params[:id])
  end
end

Using the API Gem in your Sinatra application

Here's the same example as a Sinatra application:

require 'jira-ruby'
class App < Sinatra::Base
  enable :sessions

  # This section gets called before every request. Here, we set up the
  # OAuth consumer details including the consumer key, private key,
  # site uri, and the request token, access token, and authorize paths
  before do
    options = {
      :site               => 'http://localhost:2990/',
      :context_path       => '/jira',
      :signature_method   => 'RSA-SHA1',
      :request_token_path => "/plugins/servlet/oauth/request-token",
      :authorize_path     => "/plugins/servlet/oauth/authorize",
      :access_token_path  => "/plugins/servlet/oauth/access-token",
      :private_key_file   => "rsakey.pem",
      :rest_base_path     => "/rest/api/2",
      :consumer_key       => "jira-ruby-example"
    }

    @jira_client = JIRA::Client.new(options)
    @jira_client.consumer.http.set_debug_output($stderr)

    # Add AccessToken if authorised previously.
    if session[:jira_auth]
      @jira_client.set_access_token(
        session[:jira_auth][:access_token],
        session[:jira_auth][:access_key]
      )
    end
  end


  # Starting point: http://<yourserver>/
  # This will serve up a login link if you're not logged in. If you are, it'll show some user info and a
  # signout link
  get '/' do
    if !session[:jira_auth]
      # not logged in
      <<-eos
        <h1>jira-ruby (JIRA 5 Ruby Gem) demo </h1>You're not signed in. Why don't you
        <a href=/signin>sign in</a> first.
      eos
    else
      #logged in
      @issues = @jira_client.Issue.all

      # HTTP response inlined with bind data below...
      <<-eos
        You're now signed in. There #{@issues.count == 1 ? "is" : "are"} #{@issues.count}
        issue#{@issues.count == 1 ? "" : "s"} in this JIRA instance. <a href='/signout'>Signout</a>
      eos
    end
  end

  # http://<yourserver>/signin
  # Initiates the OAuth dance by first requesting a token then redirecting to
  # http://<yourserver>/auth to get the @access_token
  get '/signin' do
    callback_url = "#{request.base_url}/callback"
    request_token = @jira_client.request_token(oauth_callback: callback_url)
    session[:request_token] = request_token.token
    session[:request_secret] = request_token.secret

    redirect request_token.authorize_url
  end

  # http://<yourserver>/callback
  # Retrieves the @access_token then stores it inside a session cookie. In a real app,
  # you'll want to persist the token in a datastore associated with the user.
  get "/callback" do
    request_token = @jira_client.set_request_token(
      session[:request_token], session[:request_secret]
    )
    access_token = @jira_client.init_access_token(
      :oauth_verifier => params[:oauth_verifier]
    )

    session[:jira_auth] = {
      :access_token => access_token.token,
      :access_key => access_token.secret
    }

    session.delete(:request_token)
    session.delete(:request_secret)

    redirect "/"
  end

  # http://<yourserver>/signout
  # Expires the session
  get "/signout" do
    session.delete(:jira_auth)
    redirect "/"
  end
end

Using the API Gem in a 2 legged context

Here's an example on how to use 2 legged OAuth:

require 'rubygems'
require 'pp'
require 'jira-ruby'

options = {
            :site               => 'http://localhost:2990/',
            :context_path       => '/jira',
            :signature_method   => 'RSA-SHA1',
            :private_key_file   => "rsakey.pem",
            :rest_base_path     => "/rest/api/2",
            :auth_type => :oauth_2legged,
            :consumer_key       => "jira-ruby-example"
          }

client = JIRA::Client.new(options)

client.set_access_token("","")

# Show all projects
projects = client.Project.all

projects.each do |project|
  puts "Project -> key: #{project.key}, name: #{project.name}"
end

jira-ruby's People

Contributors

adambedford avatar akolomiychuk avatar arincon9 avatar bobbrodie avatar cbelsole avatar dafalcon-aka avatar derrudi77 avatar garciaf avatar glsignal avatar grundic avatar halyph avatar jcouball avatar kalinon avatar kevinbutterfield avatar legkvla avatar ljharb avatar marlinpierce avatar orangewolf avatar peterbell215 avatar rmanalan avatar samanthakem avatar sandychapman avatar shirish-pampoorickal avatar siarheifedartsou avatar sikora avatar simonmiaou avatar smcfarlane avatar thebluber avatar wireframe avatar yrb 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  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

jira-ruby's Issues

errant ':'

Just pulled this from github and got:
gems/jira-0.1.0/lib/jira/cli.rb:24: syntax error, unexpected ':'

case action
when 'list': <<<<<<

Compatibility with Rails 4.2

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    jira-ruby (>= 0) ruby depends on
      activesupport (~> 4.1.4) ruby

getting error

I have setup a new rails 3.2 to test out this gem, and copied the code in the readme. When I try to access the controller I'm getting the following error.

uninitialized constant JIRA::Client

Started GET "/index/index" for 127.0.0.1 at 2012-02-15 10:29:21 -0600

ActionController::RoutingError (uninitialized constant JIRA::Client):
app/controllers/application_controller.rb:3:in <class:ApplicationController>' app/controllers/application_controller.rb:1:in<top (required)>'
app/controllers/index_controller.rb:1:in `<top (required)>'

the top required part is the "jira" I'm not sure if that is even correct since it can't find the file.

This is what I have on my gem file gem 'jira-ruby', :git => 'git://github.com/trineo/jira-ruby.git'

Too many dependencies

Hello everyone,

I am currently using this gem for a commandline utility that fetches information from JIRA.

I only use the Basic Authentication (username and password).

But this whole project has a huge dependecy tree as rack/activesupport/activemodel etc... are required.

I'm pretty sure that most of the gems are not required if you are not using OAuth.

So is there a way to reduce the dependencies if you only use a subset of the functionality (e.g. split this project in smaller projects)

more information

Can you provide more information in the readme for "This public key and consumer key will need to be generated by the Gem user, using OpenSSL or similar to generate the public key and the provided rake task to generate the consumer key." What is the provided rake task for generating the consumer key? For example the command needed to execute the rake task to generate the consumer key.

undefined method `downcase' for nil:NilClass

undefined method `downcase' for nil:NilClass
Extracted source (around line #5):
4. def new
5. request_token = @jira_client.request_token
6. session[:request_token] = request_token.token
7. session[:request_secret] = request_token.secret

app/controllers/jira_sessions_controller.rb:5:in `new'

Adding jql to QUERY_PARAMS_FOR_SEARCH

I tried in many ways to make project.issues and Issue.jql give me all the issues that are Stories but failed to do so.

project.issues({ :jql => "project="#{current_product.jira_id}" and issuetype="Story"", :startAt => 0, :maxResults => -1 }) just gives me all the issues because the :jql paramater is removed due to query_params_for_search removing it ... and a solution would be adding the :jql parameter to QUERY_PARAMS_FOR_SEARCH in base.rb (i forked the project and tested this locally and it works)

JIRA::Resource::Issue.jql(client, "project="#{current_product.jira_id}" and issuetype="Story"") gives me just 50 user stories ... I couldn't specify the startAt and maxResults parameters, trying to add them to the jql string doesn't work because of the CGI.escape

The advantage in adding the :jql parameter is that you can make custom queries using project.issues and still have the maxResults and startAt options ... I'm pretty new to this so I may have missed something obvious (sorry in advance :p).
Any help would greatly be appreciated.

Errno::EINVAL: Invalid argument - C:/Ruby193/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/spec/mock_responses/user?username=

I am having an issue installing this gem with and without Bundler. I am using Windows 7. Searches for this error come up with zero hits...

The full error is:

Installing jira-ruby (0.0.3)
Errno::EINVAL: Invalid argument - C:/Ruby193/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/spec/mock_responses/user?username=
admin.json
An error occured while installing jira-ruby (0.0.3), and Bundler cannot continue.
Make sure that gem install jira-ruby -v '0.0.3' succeeds before bundling.

Please let me know if this means anything to anyone. Thanks.

Upload attachment

Hello guys, is there a way to upload an attachment using your gem?
Thanks for your time

exception when attempting to update description of an issue

When running the code in gist below, I get the following exception:

/Users/shoop/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/net/http/response.rb:41:in `read_status_line': wrong status line: "" (Net::HTTPBadResponse)

https://gist.github.com/ShoopIndy/5607733

This happens with both 1.9.3 and 2.0.

I can post a new comment just fine, but I can't seem to put to an existing issue.

Am I doing something wrong (PEBKAC), or is the JIRA API not providing a valid response?

Saving customfields

I'm running into a Bad Format response when I attempt to set the value of a CustomField that was previously nil.
If it already exists, on the simple case it's a String, then the same works fine by setting the payload to:
issue.save(:fields=>{:customfield_11433 => "New Value"})

But if issue.fields[:customfield_1433] is nil then this will not work correctly and returns BadRequest.
Ironically, the Atlassian documentation is a little thin on how to do this.

all Method does not return all

By default is seems that Jira will only return the top 50 results from a search. What this means if you you really want to iterate all results with this gem, you cannot. Imagine that you had 100 Issues and you called

client.Issue.all.each do |issue|
  puts "#{issue.id} - #{issue.fields['summary']}"
end

Only 50 Issues would be returned.

Init client via Basic Auth

Hello ,
I need help for the simplest thing!
I am trying to init the client via basic Auth locally.

  • I set up the Jira sdk
  • I configured Jira Application Links with http://localhost:3000
  • I added the gem to my gemfile

Then, when I try to run this simple script in my rails console

username = "admin"
password = "admin"
options = {
        :username => username,
        :password => password,
        :ssl_verify_mode    =>OpenSSL::SSL::VERIFY_NONE ,
        :auth_type          => :basic
}
client = JIRA::Client.new(options)
projects = client.Project.all

I got the error

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol

What did I do wrong ?

EDIT: Found my mistake I did not need ssl in this case
Thanks

Create Project example

Hi,
I was trying the gem and works very well for me. I could Find Project, create Issues, etc.

The question is about create a new Project using the gem. It's supported by the gem?

There is a working example for try for create Projects?
I was trying with different attributes, but I'm getting false in the save.
May be could be nice to show the error message in case some issue in save in case the api return that information.
thanks!

Linking issues

Hello

Is there a way to create link relationships between issues? I need to do it both within the same JIRA instance and across multiple instances.

Thanks!

Transitions

is there anything that does transitions or is there an example?

debug_output option

Could you please add debug_output option like the following:

Usage:

options = {
...
:debug_output => false # $stderr
}

Change

jira/http_client.rb

def http_conn(uri)
  http_conn = Net::HTTP.new(uri.host, uri.port)
  ...
  if @options[:debug_output]
    http_conn.set_debug_output @options[:debug_output]
  end
 ...

And similar for oauth_client probably, I guess this code in readme is not valid:

@jira_client.consumer.http.set_debug_output($stderr)

Thank you!

P.S. thank you for the great gem! I'm trying it for creating worklogs, and it works, e.g.:

issue = client.Issue.find('TEST-3')
worklog = issue.worklogs.build
worklog.save!(:started => "2012-09-29T09:00:00.000+0000", :timeSpentSeconds => 3600, :comment => "test")

Fetching an Issue over SSL fails without specifying :443

I'm using 0.1.9, connecting to a local jira instance over ssl.

When doing a standard issue creation per the example, I get a bad response code when I do an issue.fetch:

/usr/lib/ruby/1.9.1/net/http.rb:2565:in `read_status_line': wrong status line: "<html>" (Net::HTTPBadResponse)

I'm doing:

issue.save(issue_json)  #works
issue.fetch # HTTPBadResponse
pp issue

This works, however, if I set my :site to have :443 in the url.

With wireshark I can confirm that there isn't any traffic going over http (80), so issue.fetch is going over 443, even if I don't explicitly say to.

To reiterate: this issue.fetch works with:

:site => 'https://jira.mycompany.com:443/',

HTTPBadResponse with

:site => 'https://jira.mycompany.com/',

I don't really know how to help more besides making the issue. If you can hint at where I should be looking to debug this, please let me know and I can investigate more.

I can manually have :443 in my :stite as a workaround for now.

Error in lib/jira/cli.rb:24

Requiring 'jira' fails for me in 1.9.3p194 due to a rogue colon at the end of line 24 in cli.rb

Removing it fixes the problem.

CLI OAuth verifier

I am trying to Oauth verifier using CLI. Can I use Oauth verifier for CLI? If yes than give me some idea how can I work with that. Last couple of week I am trying that but I cant get success.

Thanks.
Divyang

Irregular Inflector rule for 'status' breakes my routes

Hey guys,

You've added irregular Inflector rule for word 'status':

require 'active_support/inflector'
ActiveSupport::Inflector.inflections do |inflector|
  inflector.singular 'status', 'status'
end

But it breakes my application routes.

Without jira-ruby gem:

$ rake routes | grep work_order_statuses
                                   work_order_statuses GET    /work_order/statuses(.:format)                                                                                                                            work_order/statuses#index

With jira-ruby gem:

$ rake routes | grep work_order_statuses
                             work_order_statuses_index GET    /work_order/statuses(.:format)                                                                                                                            work_order/statuses#index

Why do you think singular form of 'statuses' should be 'statuses'?

Gem is not 1.8 compatible, requires 1.9

Just filing this as an FYI for people, not sure if the docs already mention this or if it should even be fixed, it just confused me a bit.

(15:05:07):cmyers@cmyers-ubuntu:3 master] rvm use ruby-1.8.7-p352
Using /home/cmyers/.rvm/gems/ruby-1.8.7-p352
(15:06:17):cmyers@cmyers-ubuntu:3 master] ruby -c ./lib/jira/oauth_client.rb
./lib/jira/oauth_client.rb:74: syntax error, unexpected ')', expecting '='
./lib/jira/oauth_client.rb:84: syntax error, unexpected kEND, expecting $end
(15:06:20):cmyers@cmyers-ubuntu:3 master] rvm use ruby-1.9.2-p180
Using /home/cmyers/.rvm/gems/ruby-1.9.2-p180
(15:06:26):cmyers@cmyers-ubuntu:3 master] ruby -c ./lib/jira/oauth_client.rb
Syntax OK

Validation errors not passed through to client

Hi,

Say I have a Required custom field, and attempt to create a JIRA issue without specifying it:

issue = client.Issue.build
issue.save({"fields"=>{"summary"=>"blarg from in example.rb","project"=>{"id"=>"12300"},"issuetype"=>{"id"=>"20"}}})

The error is highly cryptic: "Method Not Allowed":

/usr/local/lib/ruby/gems/2.1.0/gems/jira-ruby-0.1.13/lib/jira/request_client.rb:14:in `request': Method Not Allowed (JIRA::HTTPError)
    from /usr/local/lib/ruby/gems/2.1.0/gems/jira-ruby-0.1.13/lib/jira/client.rb:159:in `request'
    from /usr/local/lib/ruby/gems/2.1.0/gems/jira-ruby-0.1.13/lib/jira/client.rb:138:in `get'
    from /usr/local/lib/ruby/gems/2.1.0/gems/jira-ruby-0.1.13/lib/jira/base.rb:339:in `fetch'
    from ./createtestpos.rb:13:in `<main>'

The real error message ("$field is required.") should be parsed out of the 400 response and returned.

Incompatible with latest Sinatra

I dont know if this will ever get picked up but this gem is now incompatible with Sinatra as they depend on conflicting versions of rack:

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    jira-ruby (>= 0) ruby depends on
      rack (~> 1.2.1) ruby

    sinatra (>= 0) ruby depends on
      rack (1.5.2)

Running a rake, fails and asks for a delegation target

I am trying to use the gem with ruby 1.8.7 and rails 3.0.7.
However it gives me a error when trying to generate a consumer key or when i try to run a rake task.

Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, :to => :greeter).
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/core_ext/module/delegation.rb:109:in delegate' /usr/lib/ruby/gems/1.8/gems/jira-ruby-0.0.3/lib/jira/http_error.rb:7 /usr/lib/ruby/gems/1.8/gems/jira-ruby-0.0.3/lib/jira.rb:11:inrequire'
/usr/lib/ruby/gems/1.8/gems/jira-ruby-0.0.3/lib/jira.rb:11
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in require' /usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:inrequire'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in each' /usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:inrequire'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in each' /usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:inrequire'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'

Add support for 'resolution' field

Hey chaps,

I'm using this gem for a nice little script to create a html report of project work from JIRA. It's lovely so first of all thanks for all the good work.

Secondly, I'm doing a nasty hack[1] to get access to the resolution field but it strikes me that it would be better if I or another would add support for this in the same way that, say, status is supported[2].

I've done a little research and it looks to me that the json that is returned as the resolution field is not dis-similar in structure from that which is returned from status field [3]. So is adding support for resolution as simple as adding the below change to issue.rb?

has_one :resolution,    :nested_under => 'fields'

Kind regards,
Adam.

[1]

resolution = JSON.parse(issue.to_json)["fields"]["resolution"]["name"]

[2]

status = issue.status.name

[3]

DEBUG: JSON.parse(issue.status.to_json)
{"self"=>"https://steelzebra.atlassian.net/rest/api/2/status/6",
 "description"=>
  "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.",
 "iconUrl"=>
  "https://steelzebra.atlassian.net/images/icons/statuses/closed.png",
 "name"=>"Closed",
 "id"=>"6",
 "statusCategory"=>
  {"self"=>"https://steelzebra.atlassian.net/rest/api/2/statuscategory/3",
   "id"=>3,
   "key"=>"done",
   "colorName"=>"green",
   "name"=>"Complete"}}
--------
DEBUG: JSON.parse(issue.to_json)["fields"]["resolution"]
{"self"=>"https://steelzebra.atlassian.net/rest/api/2/resolution/1",
 "id"=>"1",
 "description"=>"A fix for this issue is checked into the tree and tested.",
 "name"=>"Fixed"}
--------

JQL with expanded changelog

You can use the issue finder to get the changelog but not sql. This can cause an excess of queries. Is there a way around this? I can't seem to find a way to pass in expand=changelog into the jql function just: jql, fields, startAt, and maxResults. Source

client.Issue.jql('project = VIT AND sprint in openSprints()').each do |issue|
  issue = client.Issue.find(issue.key, {expand: 'changelog'})
end

Saving/deleting a comment doesn't work with Jira 6

I can confirm saving/deleting a comment doesn't work in 0.1.11

The reason is, during a request, url path has the first character "/" being removed.

See working "GET issues" vs not working "PUT comment".
I traced it by putting custom logs inside lib/jira/http_client.rb#make_request

get
/rest/api/2/issue/MWS-303
{"Accept"=>"application/json"}

vs not working, and resulting in:
lib/jira/request_client.rb:14:in `request': Bad Request (JIRA::HTTPError)

:put
"rest/api/2/issue/30259/comment/41171"
{"Content-Type"=>"application/json"}
"{\"body\":\"cccc\"}"

Plans for allowing Basic Auth in addition to OAuth?

Great work so far on the gem!

I wanted to ask whether you plan to support basic auth in addition to OAuth with this gem. I'm working on a command line utility that I'd love to use this gem for, but OAuth is a non-starter since the people using the gem might not have administrative rights to the JIRA instance they want to work with (and additionally, supplying a user name and password isn't as big a deal if it's staying on their local machine)

I'd love to help out and implement this - looking at the code, it seems like it wouldn't be too difficult to have two client subclasses - one for OAuth and one for basic auth (they probably wouldn't have too much unique functionality outside of request and some oauth specific things), but obviously that would involve a breaking change for how you initialize the client.

I'm happy to go ahead with this if you're interested and are willing to accept a breaking change.

Please provide a jira-ruby example that runs on the command-line

First off, thank you very much for the gem. It certainly looks promising. No doubt, as soon as I figure out to harness the power of this gem is will help us a great deal. I have tried to take the examples you provide and turn them into a command-line jira capable app, but alas to no avail.

when I tried my own adaptation I see this

/usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/client.rb:132:in access_token': init_access_token must be called before using the client (JIRA::Client::UninitializedAccessTokenError) from /usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/client.rb:164:inrequest'
from /usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/client.rb:141:in get' from /usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/base.rb:333:infetch'
from /usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/base.rb:108:in find' from /usr/local/lib/ruby/gems/1.9.1/gems/jira-ruby-0.0.3/lib/jira/base_factory.rb:33:inblock (2 levels) in delegate_to_target_class'

--code snippet --

  options   = Hash.new()
  home   = "/home/noel/work/dataPuller"
  options = {
    :site               => 'http://localhost:2990',
    :signature_method   => 'RSA-SHA1',
    :request_token_path => "#{home}/oauth/request-token",
    :authorize_path     => "#{home}/oauth/authorize",
    :access_token_path  => "#{home}/jira/plugins/servlet/oauth/access-token",
    :private_key_file   => "#{home}/sslKeys/rsakey.pem",
    :rest_base_path     => "/jira/rest/api/2"
  }


  @jira_client = JIRA::Client.new('jira-ruby-example', '', options)
  @jira_client.consumer.http.set_debug_output($stderr)

  project = @jira_client.Project.find('test issue1 for Jira REST API')
  project.issues.each do |issue|
    puts "#{issue.id} - #{issue.summary}"
  end

-- end code snippet --

when I tried firing up the sinatra example I see this

[2012-06-07 15:43:47] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
localhost - - [07/Jun/2012:15:43:47 PDT] "GET /sinatra/404.png HTTP/1.1" 304 0
http://localhost:4567/?Response -> /sinatra/404.png
localhost - - [07/Jun/2012:15:43:47 PDT] "GET /favicon.ico HTTP/1.1" 404 447

  • -> /favicon.ico
    localhost - - [07/Jun/2012:15:43:56 PDT] "GET /&Response HTTP/1.1" 404 445
  • -> /&Response
    localhost - - [07/Jun/2012:15:43:56 PDT] "GET /favicon.ico HTTP/1.1" 404 447
  • -> /favicon.ico

any help is greatly appreciated.
note * do have the prep in place for OAuth, that appears to be okay.

Lock down dependency versions

It seems the build is failing because:

 1) JIRA::Resource::Attachment it should behave like a resource gracefully handles non-json responses

Failure/Error: subject.save('foo' => 'bar').should be_false

expected false to respond to `false?`

Shared Example Group: "a resource" called from ./spec/integration/attachment_spec.rb:19

# ./spec/support/shared_examples/integration.rb:62:in `block (2 levels) in <top (required)>'

This is because the truthiness methods were changed in Rspec 3.0. I suggest fixing the tests and locking down the dependencies to stop this from happening again.

Syntax error from jira/cli

/Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:28: warning: else without rescue is useless
/Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:24: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' (SyntaxError)
/Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:65: syntax error, unexpected keyword_end, expecting $end
    from /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira.rb:5:in `<top (required)>'
    from /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
    from /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
    from /Users/kevzettler/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
    from jira_api.rb:3:in `<main>'

How to get all issues assigned to the current user?

Sorry, I didn't see a mailing list for posting this question...I'm getting started using this gem and would like to know how I can get the issues assigned to the current user (ideally the issues assigned to that user for the current sprint). I can't seem to find an example of how to do this. Any tips would be a big help. Thanks!

Delete does not work on resources

Hi,
I want to delete a resource which doesn't seem to work for me:

new_issue = client.Issue.build()
new_issue.save({"fields"=>{"summary"=>"test 123","project"=>{"key"=>"JIRA"}, :issuetype => {:name => 'Bug'}}})
new_issue.delete

or

issue = client.Issue.find('JIRA-123')
issue.comments.last.delete

or others (e.g. version)
will always result in:

/lib/ruby/gems/1.9.1/gems/jira-ruby-0.1.10/lib/jira/request_client.rb:14:in `request': Bad Request (JIRA::HTTPError)
    from /lib/ruby/gems/1.9.1/gems/jira-ruby-0.1.10/lib/jira/client.rb:155:in `request'
    from /lib/ruby/gems/1.9.1/gems/jira-ruby-0.1.10/lib/jira/client.rb:130:in `delete'
    from /lib/ruby/gems/1.9.1/gems/jira-ruby-0.1.10/lib/jira/base.rb:405:in `delete'
...

I'm running jira-ruby against a Jira version 6.1.5 and the same user can do deletes via http REST calls.

Thanks in advance.

Support for OnDemand

Hi - ran into you at Summit2012 and was visiting this code for use in our OnDemand instance.

It appears that OnDemand doesn't offer the option to register these OAuth links. Maybe I'm missing something here...
If that is the case - do you know what options are available for connecting to Jira OnDemand?
If that is not the case - can you provide me with a hint on where to find this in the admin? I've been searching for Application Links and am coming up empty.

JIRA 6.5: Saving Fields consistently throws a 400: Bad Request

I have debugged this and found that the base.rb - url method (when hitting the if @attrs['self'] case) was not utilizing the prefix and creating urls that did not start with a slash (/) prefix. I'm going to issue a pull request to address this.

I have tested it and found it to work for Jira 6.5. I would assume this will be a universal fix, though.

require 'jira' / API Gem in a command line application broken

I cannot require the 'jira' gem in ruby 1.9.3-p484. In either a OSX or Win7 environment, both with same version of ruby. Please fix! Would really like to use this gem.

Here is the error.

irb(main):001:0> require 'pp'
=> true
irb(main):002:0> require 'jira'
/Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:28: warning: else without rescue is useless
SyntaxError: /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:24: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n'
/Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira/cli.rb:65: syntax error, unexpected keyword_end, expecting $end
from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/jira-0.1.0/lib/jira.rb:5:in <top (required)>' from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:60:inrequire'
from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in rescue in require' from /Users/daviss/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:35:inrequire'
from (irb):2
from /Users/daviss/.rbenv/versions/1.9.3-p484/bin/irb:12:in `

'
irb(main):003:0> require 'rubygems'

Issue All error

I'm getting an error when running 'client.Issue.all' when running code in the console. Any help is greatly appreciative.

JRuby 1.7.10
Mac

Trace:

jruby-1.7.10 :029 > client.Issue.all
NoMethodError: undefined method split' for :expand:Symbol from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1598:incapitalize'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1591:in each_capitalized' from org/jruby/RubyHash.java:1338:ineach'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1590:in each_capitalized' from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:2081:inwrite_header'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1933:in exec' from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1325:intransport_request'
from org/jruby/RubyKernel.java:1282:in catch' from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1324:intransport_request'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1301:in request' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:inrequest'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1294:in request' from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:745:instart'
from /Users/bxiong/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1292:in request' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:inrequest'
from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/http_client.rb:22:in make_request' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/request_client.rb:13:inrequest'
from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/client.rb:151:in request' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/client.rb:130:inget'
from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/resource/issue.rb:37:in all' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/jira-ruby-0.1.8/lib/jira/base_factory.rb:33:inall'
from (irb):29:in evaluate' from org/jruby/RubyKernel.java:1119:ineval'
from org/jruby/RubyKernel.java:1519:in loop' from org/jruby/RubyKernel.java:1282:incatch'
from org/jruby/RubyKernel.java:1282:in catch' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/railties-3.2.17/lib/rails/commands/console.rb:47:instart'
from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/railties-3.2.17/lib/rails/commands/console.rb:8:in start' from /Users/bxiong/.rvm/gems/jruby-1.7.10@test/gems/railties-3.2.17/lib/rails/commands.rb:41:in(root)'
from org/jruby/RubyKernel.java:1083:in require' from script/rails:6:in(root)'jruby-1.7.10 :030 >

Not possible to update an existing issue?

I've spent about the last six hours trying to figure out how to use the JIRA API from Ruby, using this gem, to create, update, and comment on an issue in JIRA. Simple, right? NO. This gem is so poorly documented that it took hours just to log into our JIRA account with it because the secret of using :context => '' is not mentioned anywhere and I had to figure it out myself. Then I had to figure out how to find the IDs for projects and issue types by inspecting the HTML from atlassian.net and I was finally able to post an issue.

Updating an existing issue, however, is a complete mystery. I'm guessing that it will be like the other issues: that it will work if I can find some sample code somewhere. The sample code in the documentation for updating records absolutely does not work. Now I'm just throwing things against the wall to see if anything sticks. I seriously think that I would have been better off pulling out Capybara and writing a web bot to do this instead of trying to use this terrible API gem.

Here are a few examples of failed attempts to post an update to an existing issue. I get a 400 response and no error messages in the issue's data structure.

client = JIRA::Client.new(options)
issue = client.Issue.find('ENG-23')
begin
  issue.save!(
      {
        'fields' =>
          {
            'description' => 'This story was posted by a bot.'
          }      
      }
    )
rescue JIRA::HTTPError => e
  puts e.response.code
  puts e.response.message
  puts e.response.body  
end 

Result:

$ bundle exec ruby jira.rb 
400
Bad Request
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

That mirrors the structure used to create that same issue, with the fields nested under 'fields'. But obviously it doesn't work. And it provides absolutely no hint about why it didn't work.

Another attempt:

client = JIRA::Client.new(options)
issue = client.Issue.find('ENG-23')
begin
  issue.save!(
      {
        'description' => 'This story was posted by a bot.'
      }
    )
rescue JIRA::HTTPError => e
  puts e.response.code
  puts e.response.message
  puts e.response.body  
end 

Result:

$ bundle exec ruby jira.rb 
400
Bad Request
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

Another attempt:

client = JIRA::Client.new(options)
issue = client.Issue.find('ENG-23')
issue.set_attrs(
    {
      'fields'=>
        {
          'summary' => 'Hello, World!',
          'description' => 'This story was posted by a bot.',
          'project' => {'id' => 10207}, # ENG -- Engineering,
          'issuetype' => {'id' => 10206} # Story
        }
    }
  )
begin
  issue.save!({})
rescue JIRA::HTTPError => e
  puts e.response.code
  puts e.response.message
  puts e.response.body  
end 

Result:

$ bundle exec ruby jira.rb 
400
Bad Request
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

Another attempt:

client = JIRA::Client.new(options)
issue = client.Issue.find('ENG-23')
begin
  issue.save!(
      {
        'fields'=>
          {
            'summary' => 'Hello, World!',
            'description' => 'This story was posted by a bot.',
            'project' => {'id' => 10207}, # ENG -- Engineering,
            'issuetype' => {'id' => 10206} # Story
          }
      }
    )
rescue JIRA::HTTPError => e
  puts e.response.code
  puts e.response.message
  puts e.response.body  
end 

Same result.

The real issue here is that I'm an idiot for wasting so much of my time on trying to make this work when it's obviously never going to work. Is that correct? Or can this gem actually update issues in JIRA?

If this gem can't update issues in JIRA then why is it wasting space on GitHub?

Add support for expanded responses

From https://docs.atlassian.com/jira/REST/5.2.11/:

In order to minimise network traffic and server CPU usage, the JIRA REST API sometimes uses a technique called expansion. When a REST resource uses expansion then parts of that resource will not be included in the JSON response unless explicitly requested. The way to request those fragments to be included is by using the expand query parameter.

You can use the expand query parameter to specify a comma-separated list of entities that you want expanded, identifying each of them by name. For example, appending ?expand=names,renderedFields to an issue's URI requests the inclusion of the translated field names and the HTML-rendered field values in the response. Continuing with our example above, we would use the following URL to get that information for JRA-9:

https://jira.atlassian.com/rest/api/latest/issue/JRA-9?expand=names,renderedFields

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.