get issue close date - jira-rest-api

I want to know the date in which a given issue is closed.
haw can I get issue close date via Jira rest API?or from Jira rest java client?
I try to get the update date but it give the date of last update and not the close date.
Is there any way in Jira rest java client or in Jira rest API?
Thank you for answering me.

When searching for issues you need to add expand parameter into search_issues() See here.
Then all changes in issue should be in changelog field. You can list them in similar way:
from jira.client import JIRA
jira = JIRA(options={'server':'http://jira.server.address.com'},basic_auth=('user','password'))
issues = jira.search_issues('key=PR-1',expand='changelog')
for issue in issues:
print issue.key
for change in issue.changelog.histories:
print "== Change id ==", change.id
for change_item in change.items:
print " ",change.created, change_item.field, change_item.fromString, change_item.toString

Related

ArcGIS url query using date parameter stopped working overnight

Until a few days ago, this query ran without problems:
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt>='2022-05-01'&outFields=*&returnGeometry=false&outSR=4326&f=json
Now it returns:
error
code 400
extendedCode -2147220985
message "Unable to complete operation."
details []
The URL without RptDt specification still works just fine:
https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=1%3D1&outFields=*&returnGeometry=false&outSR=4326&f=json
Here is a link to the open data portal resource.
The trouble appears to be in this bit: where=RptDt>='2022-05-01'.
Did ArcGIS change the formatting for date values? Does anyone know how I can update my URL to work properly?
If you change the date query to use a standardized date format it seems to work fine, ie using RptDt>=date'2022-05-01' instead of RptDt>='2022-05-01'.
Updated example URL: https://dhsgis.wi.gov/server/rest/services/DHS_COVID19/COVID19_WI_V2/MapServer/11/query?where=RptDt%3E=date%272022-05-01%27&outFields=*&returnGeometry=false&outSR=4326&f=json

Issues pulling change log using python

I am trying to query and pull changelog details using python.
The below code returns the list of issues in the project.
issued = jira.search_issues('project= proj_a', maxResults=5)
for issue in issued:
print(issue)
I am trying to pass values obtained in the issue above
issues = jira.issue(issue,expand='changelog')
changelog = issues.changelog
projects = jira.project(project)
I get the below error on trying the above:
JIRAError: JiraError HTTP 404 url: https://abc.atlassian.net/rest/api/2/issue/issue?expand=changelog
text: Issue does not exist or you do not have permission to see it.
Could anyone advise as to where am I going wrong or what permissions do I need.
Please note, if I pass a specific issue_id in the above code it works just fine but I am trying to pass a list of issue_id
You can already receive all the changelog data in the search_issues() method so you don't have to get the changelog by iterating over each issue and making another API call for each issue. Check out the code below for examples on how to work with the changelog.
issues = jira.search_issues('project= proj_a', maxResults=5, expand='changelog')
for issue in issues:
print(f"Changes from issue: {issue.key} {issue.fields.summary}")
print(f"Number of Changelog entries found: {issue.changelog.total}") # number of changelog entries (careful, each entry can have multiple field changes)
for history in issue.changelog.histories:
print(f"Author: {history.author}") # person who did the change
print(f"Timestamp: {history.created}") # when did the change happen?
print("\nListing all items that changed:")
for item in history.items:
print(f"Field name: {item.field}") # field to which the change happened
print(f"Changed to: {item.toString}") # new value, item.to might be better in some cases depending on your needs.
print(f"Changed from: {item.fromString}") # old value, item.from might be better in some cases depending on your needs.
print()
print()
Just to explain what you did wrong before when iterating over each issue: you have to use the issue.key, not the issue-resource itself. When you simply pass the issue, it won't be handled correctly as a parameter in jira.issue(). Instead, pass issue.key:
for issue in issues:
print(issue.key)
myIssue = jira.issue(issue.key, expand='changelog')

Branch.io - Export Credits Data out of Branch

Is there a way to export credits data out of branch.io - either via APIs or manually?
I've tried
(1) APIs:
https://api.branch.io/v1/credits?branch_key=<key>&identity=<dev_id>
but I need something like
https://api.branch.io/v1/credits?branch_key=<key>&date=20180528 (extract based on date or date range).
(2) Manual CSV download - there doesn't seem to be a credits download option anywhere?
Also tried the data Export API which only has the following items for download:
eo_branch_cta_view,
eo_click
eo_commerce_event
eo_custom_event
eo_install
eo_open
eo_pageview
eo_reinstall
eo_sms_sent
eo_web_session_start
Please, can someone help?
Thanks!
This is Vatsal, from Branch.io!
Our new Liveview currently is in the process of supporting Credits Exports. For now, you can temporarily switch back to the old version of the Liveview and download the Credits exports as before. To do that, you can append "?pba_liveview=false" like this: https://dashboard.branch.io/liveview/credits?pba_liveview=false
To switch back, you can set https://dashboard.branch.io/liveview/credits?pba_liveview=true
Hope this helps.

Adwords api report without download

I'm working with Adwords API, I already can download reports like: all keywords with impressions, clics, ctr, conversions, etc...
The problem is, I need to show this report on our web tool when the user set the date range.
Now I'm doing this: The user selects Start Date 01/09/2014 End Date 15/09/2014, I call Adwords Api, download CSV, parsing it, and then show the results on the screen, but this way is not optimal and I would like to know how to call the API and get the results "at the moment", getting an XML or JSON without download a file.
Is it possible??
The only way I found was calling CampaignService class.. getting all campaigns, then for each campaign calling AdgroupService for get all Adgroups, then keywords.... It's really impractical.
How can I do it?
Thank you very much.
It appears in recent versions of the libary they created a function (getAsString()) so we can achieve this:
$reportDownloader = new ReportDownloader($session);
$reportDownloadResult = $reportDownloader->downloadReport($reportDefinition);
//Normal way of downloading to file
//$reportDownloadResult->saveToFile($filePath);
//printf("Report with name '%s' was downloaded to '%s'.\n",
// $reportDefinition->getReportName(), $filePath);
//New way by calling getAsString();
$reportAsString = $reportDownloadResult->getAsString();
echo $reportAsString;
Old suggestions about passing null as the $filePath no longer work.
Yes, you can get XML without downloading file. Just set $path to Null when calling ReportUtils::DownloadReport() and it returns you response without saving it to file.
The AdWords API library (as of v201506) allows you to set the download_format to one of CSVFOREXCEL, CSV, TSV, XML, GZIPPED_CSV, or GZIPPED_XML. It unfortunately does not support JSON, even if you ask to download the report data (not as a file).
$reportAsString = $reportDownloadResult->getAsString();
$xml = simplexml_load_string($reportAsString);

Modifying workflow to add a status and split on ticket type

I am hoping that someone can help me as I am completely lost. I need to modify the workflow for TRAC so that if the ticket type is SPR, it gets assigned to our QA, and they are the only ones allowed closing the ticket. Otherwise, it goes to the test team to be closed.
As well, I need the ticket status flow to be as follows:
New Ticket(bug) -> Assigned(Dev) -> Fixed(re-assigned to Test or SPR) -> Closed/Re-opened
Currently it appears the ticket is set to closed after dev fixes the issue.
I am not familliar with TRAC at all and have been hammering away at this for 2 days now and can't seem to get it to work. Any help would be incredibly appreciated!
Try AdvancedTicketWorkflowPlugin, because it is able to act differently based on ticket field values. Most relevant here: It does so with triage operation based on ticket type according to its wiki documentation:
accept = new -> *
accept.name = Accept ticket into workflow
accept.operations = triage
accept.triage_field = type
accept.triage_split = defect->new_defect,enhancement->new_enhancement
(see a more complete example on the wiki page linked above)
You can customize the status workflow of your tickets (this is the official documentation: http://trac.edgewall.org/wiki/TracWorkflow). However, different workflows based on ticket type are not yet supported.