Giter Site home page Giter Site logo

laravel-jira's Introduction

Deprecated

This repository is deprecated and will no longer be maintained, as the Laravel and Jira APIs may have changed significantly over the last 2 years of inactivity of this package. Please feel free to clone the repository and provide your own fork! All the best!


Laravel5 Jira service

Easy access Jira rest api in Laravel5.

Installation and Requirements

composer require univerze/laravel-jira

Afterwards, run composer update from your command line.

Then, update config/app.php by adding an entry for the service provider.

'providers' => [
    // ...
    Univerze\Jira\JiraServiceProvider::class,
];

'aliases' => [
  	// ...
  	'Jira' => Univerze\Jira\Facade\JiraFacade::class,
];

Finally, from the command line again, run php artisan vendor:publish to publish the default configuration file to config/jira.php.

Searching issues

The search method will take the jql query string:

$response = Jira::search( 'project = YourProject AND labels = somelabel' );

You can build and test the jql beforehand if you go to your Jira site Issues > Search for Issues > Advanced Search.

Further information can be found on JIRA documentation - search issues

NOTE jql parameter is already included in the payload

Creating issues

$issue = Jira::create( array(
    'project'     => array(
        'key' => 'YourProject'
    ),
    'summary'     => 'This is the summary',
    'description' => 'Description here',
    'issuetype'   => array(
        'name' => 'Bug'
    )
) );

Further information can be found on JIRA documentation - create issue

NOTE fields parameter is already included in the payload

Editing issues

Jira::update( 'ISSUE-1234', array(
    'description' => 'this is my new description'
) );

In this case the JIRA api will return "204 - No Content" instead of issue details.

Further information can be found on JIRA documentation - edit issue

NOTE fields parameter is already included in the payload


Released under the MIT License. See the LICENSE file for details.

laravel-jira's People

Contributors

frankwin avatar johannesschobel avatar univerze avatar

Stargazers

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

Watchers

 avatar  avatar

laravel-jira's Issues

New lines don't work

When adding new lines in the description field for example they do not work and show up as \r\n in the JIRA ticket.

It can be fixed by adding this line in the create and update functions
$data = str_replace('\','',$data);

I created a PR for this change

Change Share() to Singleton

In JiraServiceProvider.php line 30:

Call to undefined method Illuminate\Foundation\Application::share()

Solution:
Change Line 30 in JiraServiceProvider.php to:

        $this->app->singleton('jira', function ($app) {
            return new Jira;
        } );

Dont get any results / How to configure?

Hey,

i trired to configure my jira.php in different ways:

'url' => 'https://xxx-jira.xxx.org/',
'username' => 'xxx',
'password' => 'xxxx',

'url' => 'xxx-jira.xxx.org',
'username' => 'xxx',
'password' => 'xxxx',

'url' => 'https://xxx-jira.xxx.org/rest/api/latest/issue/',
'username' => 'xxx',
'password' => 'xxxx',

But unfortunately nothing is working.

I tried following statement via Artisan tinker:

$response = Jira::search('project = XXX AND status not in (closed, resolved)');

and my response was null.

Can you help me please?

Working with oauth-token instead of user/password

HI there,
I've been working on an oauth login to my application. I was uncomfortable that every user has to save their password in my applocation.
A login with oauth to jira can be done with: https://github.com/SocialiteProviders/Jira, (docs at http://socialiteproviders.github.io/providers/jira/). There was a bug while getting the access token. which is fixed with a PR I made.

Currently I'm not able to get the information where to put the access token in the request.
I think this would be a good addition to include the auth-token in the request instead of the username/password.

I'll wait till #8 is merged to create a additional PR to add the functionality from #3 and hopefully add the oauth token to the request.

Is there a possibility that this PR will get accepted?

Changing Issues?

Hi there,
thanks for the package. Is it also planned in the future to change issues? I think "simple" operations of swithing the fixVersion or assignee would be helpful, also to maybe add comments through the api.
Regards

Result always null

Hi,

I have carefully follow instructions and ran into the same issue like this one here. The result is always null even though the username and password is correct.

URL were configured as: 'url' => 'https://my-company.atlassian.net/rest/api/latest/issue', and 'url' => 'https://my-company.atlassian.net', and 'url' => 'https://my-company.atlassian.net/rest/api', ,etc...

I also have tried accessing manually: https://my-company.atlassian.net/rest/api/latest/issue/AM-122 using same logged in account in config file and it work fine with JSON result.

Please advise, thank you!

Error: Call to undefined method Illuminate\Foundation\Application::share()

Change JiraServiceProvider.php :

public function register(){
    $this->mergeConfigFrom( __DIR__ . '/config/jira.php', 'jira' );
    $this->app['jira'] = $this->app->share( function ( $app )
    {
        return new Jira;
    } );
}

for this:

public function register()
{
    $this->mergeConfigFrom( __DIR__ . '/config/jira.php', 'jira' );
    $this->app->singleton('jira', function ($app){
       return new Jira;
    });
}

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.