thefirstavenger / elixir-ex_jira Goto Github PK
View Code? Open in Web Editor NEWElixir wrapper for the JIRA REST API
License: MIT License
Elixir wrapper for the JIRA REST API
License: MIT License
In the config options, I can only see the option to provide the user and password.
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 ?
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.