Code Monkey home page Code Monkey logo

elixir-ex_jira's People

Contributors

thefirstavenger avatar zachallett avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

elixir-ex_jira's Issues

Calling Dashboard Api

when i was calling ExJira.Dashboard.all() this api it will gives me the below error -
{:error, "Invalid content-type returned: text/plain"}
i also change the
%HTTPotion.Response{
body: body,
headers: %{hdrs: %{"content-type" => "application/json;charset=UTF-8"}}
} to
%HTTPotion.Response{
body: body,
headers: %{hdrs: %{"content-type" => "text/plain;charset=UTF-8"}}
} in request.ex but it will not work . can you please help me to solve it ?

`Request.get_more/5` returning an unhandled response type upon second request

ERROR:

17:51:30.119 [debug] ExJira.Request: Sending GET to https://jira.company_name.com/rest/api/latest/dashboard?startAt=20&&maxResults=300 using Elixir.HTTPotion
** (FunctionClauseError) no function clause matching in ExJira.Request.get_more/5

    The following arguments were given to ExJira.Request.get_more/5:

        # 1
        {:ok, %{"errorMessages" => ["The 'startAt' param (300) must be a multiple of the 'maxResults' param (20)"], "errors" => %{}}}

        # 2
         ...
        [truncated]

I believe it is related to this line:

https://github.com/TheFirstAvenger/elixir-ex_jira/blame/master/lib/ex_jira/utils/request.ex#L66

Is there a reason that the request is being constructed with a maxResult of 300 rather than just using the "next" => "https://jira.company_name.com/rest/api/latest/dashboard?maxResults=20&startAt=20" provided by the response from the previous request?

Seen here:

  ...

  "maxResults" => 20,
  "next" => "https://jira.company_name.com/rest/api/latest/dashboard?maxResults=20&startAt=20",
  "startAt" => 0,
  "total" => 27
}

The other issue that I noticed was the double ampersand in the request uri that is an effect of #{query_params} being placed in the middle of this line:

request( "GET", resource_path, "startAt=#{length(prev_items) + length(items)}&#{query_params}&maxResults=300", "" )

and then resolving to nil.

If it is alright with you I am working on a PR to resolve this issue, and is why I had the question regarding why maxResult is jumping from 20 to 300 after the first iteration.

I will try and get a PR up in the next day, work permitting.

Calling Search API

I'm having trouble getting up and running with this library.

I'm trying:

ExJira.Request.get_all("/search", "", "jql=key=SD-1000")

It returns {:ok, nil}

The log says ExJira.Request: Sending GET to https://myjira.atlassian.net/rest/api/latest/search?jql=key=SD-1000 with using Elixir.HTTPotion

I've validated that https://myjira.atlassian.net/rest/api/latest/search?jql=key=SD-1000 returns valid JSON.

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.