I am making following REST API call to my JIRA instance.
Am getting the total result as 1, but am not getting any values inside the issues : [ ]
JQL:
http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&fields=project,status&jql=fields project status jql project=C00195 and key=C00195-2210
But I'm getting an error response:
{"startAt":1,"maxResults":50,"total":1,"issues":[]}
Above JQL is not working in browser as well.
If we remove the key filter then it was working as expected.
Working JQL:
http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&jql=project=C00095
Response:
{"expand":"schema,names","startAt":1,"maxResults":50,"total":2175,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"12560","self":"http://myjira:8080/rest/api/2/issue/12560","key":"C00095-2215","fields":{"parent":{"id":"12559","key":"C00095-2214","self":"http://myjira:8080/rest/api/2/issue/12559","fields":{"summary":"Task for tagging testing","status":
You need to change startAt from 1 to 0. This resource is counting from zero so by setting it to one you actually skip the single issue that was found.
Related
I am using Elasticsearch 6.2.4 with my RoR application using elasticsearch-rails and elasticsearch-model.
My indexation is runninng without getting any errors. but when I try to perform a search from the application I am getting this error from Elasticsearch
<Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"text is empty (possibly HTTP/0.9)"}],"type":"illegal_argument_exception","reason":"text is empty (possibly HTTP/0.9)"},"status":400}>
Everything was working normal prior to the upgrade of Elasticsearch from 1.5 to 6.2.4
I simplified my search query to try narrowing down the problem.
q = { "query" => { "match_all" => {} } }
But I still getting the same error. Probably I am not specifying a type in the query but wouldn't be unnecessary since I have a match_all condition ?
> {"query":{"match_all":{}}}
< {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"text is empty (possibly HTTP/0.9)"}],"type":"illegal_argument_exception","reason":"text is empty (possibly HTTP/0.9)"},"status":400}
I am brand new to Elasticsearch so excuse me in advance if there are some evident stuff that I am missing
Do you have any idea what is causing this error ? If you need more specific info just ask and I'll update this question.
Thanks.
Search request from application is resulting in HTTP 400 Bad Request. Are you able to perform a search request from outside the application i.e. invoking a curl command from your local etc ?
I am trying to develop summary data of length of time from task creation to task completion for all tasks in a certain team. I want to look at how lang it is taking from start to finish on tasks (on average) for any given month. My team has 30 - 40 projects and we move tasks from project to project until it is completed.
I have tried the following URL on the explorer page in their documentation:
GET
/tasks?opt_fields=completed_at,completed&completed_since=2012-02-22T02%3A06%3A58.147Z&limit=10&workspace=[myworkspaceid]&project=[myprojectid]
The response I get is:
{ "errors": [
{
"message": "Must specify exactly one of project, tag, or assignee + workspace",
"help": "For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"
} ] }
Since I am specifying a project ID why am I getting this error?
************************ EDIT ************************************
OK...thanks for that. I am usding the following code and using only a workspace did indeed fix my issue. When I use the following code using asana gem in ruby I get results....363 results.
allTasks = client.tasks.find_all(assignee: nil, workspace: nil, project: 999999999999999999,completed_since: nil, modified_since: nil, per_page: 100, options: {})
allTasks.each do |task|
puts task.name
end
Let's say the developer of the Asana gem messed up and is ignoring my "per_page: 100". Isn't Asana limited to 100 or less results? Why am I getting 363? How Do I know that this really is all of them?
When you specify a project for the /tasks endpoint, you mustn't specify a workspace (the Asana API infers the workspace from the project). (Admittedly, the workspace could be optional, so I've filed this as a bug.)
Also, to directly answer your original question, we don't currently support directly querying for every task in a team. Fetching tasks in each project is the best approach.
For data mining reasons, I want to get build numbers range of a jenkins job that were built on a particular day. Is there a plugin that accomplishes this or any other possible way?
Thanks,
Nick
The built-in REST JSON API will give you a list of the builds for a particular job: http://jenkins:8080/job/JOB_NAME/api/json?tree=builds[fullDisplayName,id,number,timestamp]&pretty=true
Produces something like:
{
"builds" : [
{
"fullDisplayName" : "JOB_NAME #113",
"id" : "2014-10-31_23-05-20",
"number" : 113,
"timestamp" : 1414821920808
},
{
"fullDisplayName" : "JOB_NAME #112",
"id" : "2014-10-31_17-26-39",
"number" : 112,
"timestamp" : 1414801599000
},
....
If your build ids are the basic date-stamp (as above), you can do a little string processing to filter the results. Otherwise, you can convert the timestamp to the appropriate date and filter on that.
Most Jenkins pages have a REST API link at the bottom that provides more documentation, though you often need to experiment with the API to figure out what details it can provide.
Update: As #Nick discovered, the builds result is limited to the latest 100 elements by default. According to this Jenkins issue, you can use the hidden allBuilds element to retrieve "all builds". So if you need all builds, use: http://jenkins:8080/job/JOB_NAME/api/json?tree=allBuilds[fullDisplayName,id,number,timestamp]&pretty=true
Jenkins 1.568 also introduced pagination in the API results, so it's possible to retrieve results by range. The Jenkins REST API link describes the syntax if your Jenkins version supports it.
There is the Global Stats Plugin
Which also has a JSON REST API
This is a very specific Omniture API question. Thought I'd check here if anyone encountered this problem since Omniture forum was not of much help -
Sending the following parameters to Omniture API Explorer here - https://developer.omniture.com/en_US/get-started/api-explorer#Saint.ImportCreateJob seems to work fine.
{
"check_divisions":"1",
"description":"OSRA job description: MyReportID, Products, 51",
"email_address":"my#email.com",
"export_results":"0",
"header":["Field1", "Field2"],
"overwrite_conflicts":"1",
"relation_id":51,
"report_suite_array":["MyReportID"],
"c_view":"SomeReportName"
}
But the call fails in the actual code with a 'Bad Request'. It seems like c_view parameter is expecting a certain value. The only documentation for c_view is that it expects a report name. I've tried report names and other values with no luck. Would appreciate any pointers from Omniture API users.
Thanks.
try using the relevant value from the classification_view chart. I know this is what you need for using the get/save classifications methods (I have used those methods, but not the Saint.ImportCreateJob method).
c_value is not required, so unless you plan on using it, it does not need to be present. It is supposed to be a classification_view https://developer.omniture.com/en_US/documentation/omniture-administration/r-classification-view.
It takes some trial and error to get this api working.
Here is an example of a call I use that works using the REST api over Java:
Request:
{
"check_divisions":1,
"description":"Report Test 1",
"email_address":"cdegroot#adobe.com",
"export_results":"0",
"overwrite_conflicts":0,
"relation_id":65,
"report_suite_array":["cdgdev"],
"header":["Key","Survey","Survey^Question","Survey^Question^Response","Engagement Index","Survey > Question > Response"]
}
Response:
"3387166"
Kind Regards C.
Google provides nice examples of getting TextAd via API: https://code.google.com/p/google-api-adwords-php/source/browse/examples/v201209/BasicOperations/GetTextAds.php
I expected that getting DynamicSearchAd will be as easy as modifying line 54 to:
$selector->predicates[] = new Predicate('AdType', 'IN', array('TEXT_AD', 'DYNAMIC_SAERCH_AD'));
however for campaign with bunch of negative keywords, 0 postiive keywords and bunch of ads [ visible in the interface ] my result is buch of negative keywords and 0 ads, like they were not existing. I have googled for quite a long time already, but most recent post about keywordless ads is from 2012 and since then I believe that DynamicSearchAds went out from beta and are not available for everyone.
I played quite a little bit with sample example, changing fields [ like removing Headline and leaving only Id etc ], without success.
So my question is, how should I modify this example to obtain DSA ?
You've got missprint on constant in Predicate.
'DYNAMIC_SAERCH_AD' must be 'DYNAMIC_SEARCH_AD'