Closed johntdyer closed 10 years ago
Any thoughts guys ?
Hey @johntdyer - make sure to load the JIRA schemas
mysql -p -u morgue -h localhost morgue < schemas/jira.sql
let us know if you still see the issue
@nkammah So that seems to have taken care of the exception I was getting the logs, which is good. However I am not seeing anything in hte logs, and when onBlur hits on the field it seems to just clear. Nothing in the error log on the server either...
@nkammah - So I have been getting my jQuery on :wink: and I noticed something...
when I try this in the console:
var jira_input = $("#jira_key_input");
jira_input.attr("value", "OPS-1598");
var jira_input = $("#jira_key_input");
var jira_keys = (jira_input.attr("value"));
store_ticket_for_event(get_current_event_id(), jira_keys, function(data) {
data = JSON.parse(data);
var keys = $.map(jira_keys.split(","), function(n,i){return ($.trim(n)).toUpperCase();});
console.log("keys => " + keys);
console.log("data => " + data);
for (var i in data) {
console.log(i);
// add entries
if ($.inArray(i, keys) !== -1) {
var style = "jira_" + data[i].status.toLowerCase().replace(" ", "_");
console.log(data[i]);
var entry = "<tr class=\"jira-row\">";
entry += "<td><a href=\""+data[i].ticket_url+"\" class=\""+ style + "\">"+i+"</a></td>";
entry += "<td>"+data[i].summary+"</td>";
entry += "<td>"+data[i].assignee+"</td>";
entry += "<td>"+(data[i].due_date || "" )+"</td>";
entry += "<td><span id=\"jira-"+data[i].id+"\" class='close'>×</span></td>";
entry += "</tr>";
console.log(entry);
$('#jira_table_body').append(entry);
addTooltip($("tr[class=jira-row] a[class="+style+"]"));
}
}
jira_input.attr("value", "");
});
I get back
XHR finished loading: "http://morgue.int.xxxx.com:8080/events/1/tickets". jquery.min.js:4
keys => OPS-1598
data =>
It looks like the data payload coming back from the ajax request is empty...
@johntdyer I faced the same issue - I believe this commit should fix it. I opened a pull request for it.
@johntdyer while waiting for the pull request to go through, can you try this patch and post the results?
That got me further for sure... After doing this I ran into an issue w/ the field custom_field10090 not being valid any more. Looks like due_date is a first class / named field in JIRA now... I submitted my own pull request with a few doc changes and changes that I think might help.
I had to do a bunch of hacking around this to make it work for jira internally. We are running 4.4 and man are things different.
Yea, I am using 6 ( onDemand ). Plus my PHP skills are lacking, so I just took a stab at getting this to work.
@cwebberOps @johntdyer do you have a diff somewhere? We may be able to find a generic way to get this to work, but we should consolidate the misc. use cases.
Oh the Jira API :/. Yeah it would be great to find the common bits here.
This is the response from Jira onDemand
{
"expand": "renderedFields,names,schema,transitions,operations,editmeta,changelog",
"id": "21687",
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/issue/21687",
"key": "OPS-1598",
"fields": {
"progress": {
"progress": 0,
"total": 0
},
"summary": "test",
"timetracking": {},
"issuetype": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/issuetype/1",
"id": "1",
"description": "A problem which impairs or prevents the functions of the product.",
"iconUrl": "https://xxxxxxxx.atlassian.net/images/icons/issuetypes/bug.png",
"name": "Bug",
"subtask": false
},
"timespent": null,
"reporter": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/user?username=jdyer",
"name": "jdyer",
"emailAddress": "jdyer@tropo.com",
"avatarUrls": {
"16x16": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=xsmall&ownerId=jdyer&avatarId=10500",
"24x24": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=small&ownerId=jdyer&avatarId=10500",
"32x32": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=medium&ownerId=jdyer&avatarId=10500",
"48x48": "https://xxxxxxxx.atlassian.net/secure/useravatar?ownerId=jdyer&avatarId=10500"
},
"displayName": "John Dyer",
"active": true
},
"customfield_10816": null,
"updated": "2013-11-01T11:32:34.078-0700",
"created": "2013-11-01T10:21:30.128-0700",
"customfield_10817": null,
"description": "test",
"priority": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://xxxxxxxx.atlassian.net/images/icons/priorities/major.png",
"name": "Major",
"id": "3"
},
"customfield_10818": null,
"customfield_10819": null,
"customfield_10812": null,
"customfield_10813": null,
"customfield_10814": null,
"issuelinks": [],
"customfield_10815": null,
"customfield_10810": null,
"customfield_10811": null,
"customfield_10000": "7399",
"subtasks": [],
"status": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/status/1",
"description": "The issue is open and ready for the assignee to start work on it.",
"iconUrl": "https://xxxxxxxx.atlassian.net/images/icons/statuses/open.png",
"name": "Open",
"id": "1"
},
"labels": [
"test"
],
"workratio": -1,
"project": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/project/10204",
"id": "10204",
"key": "OPS",
"name": "Operations",
"avatarUrls": {
"16x16": "https://xxxxxxxx.atlassian.net/secure/projectavatar?size=xsmall&pid=10204&avatarId=10807",
"24x24": "https://xxxxxxxx.atlassian.net/secure/projectavatar?size=small&pid=10204&avatarId=10807",
"32x32": "https://xxxxxxxx.atlassian.net/secure/projectavatar?size=medium&pid=10204&avatarId=10807",
"48x48": "https://xxxxxxxx.atlassian.net/secure/projectavatar?pid=10204&avatarId=10807"
},
"projectCategory": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/projectCategory/10100",
"id": "10100",
"description": "",
"name": "Internal"
}
},
"customfield_11200": null,
"aggregateprogress": {
"progress": 0,
"total": 0
},
"lastViewed": null,
"components": [],
"comment": {
"startAt": 0,
"maxResults": 0,
"total": 0,
"comments": []
},
"timeoriginalestimate": null,
"customfield_10900": null,
"customfield_10901": "Not Started",
"votes": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/issue/OPS-1598/votes",
"votes": 0,
"hasVoted": false
},
"customfield_11100": null,
"resolution": null,
"fixVersions": [],
"resolutiondate": null,
"aggregatetimeoriginalestimate": null,
"customfield_11000": null,
"duedate": "2013-11-08",
"watches": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/issue/OPS-1598/watchers",
"watchCount": 1,
"isWatching": false
},
"worklog": {
"startAt": 0,
"maxResults": 20,
"total": 0,
"worklogs": []
},
"customfield_10103": null,
"customfield_10601": null,
"customfield_10102": null,
"customfield_10600": null,
"customfield_10101": null,
"customfield_10100": null,
"assignee": {
"self": "https://xxxxxxxx.atlassian.net/rest/api/2/user?username=jdyer",
"name": "jdyer",
"emailAddress": "jdyer@tropo.com",
"avatarUrls": {
"16x16": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=xsmall&ownerId=jdyer&avatarId=10500",
"24x24": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=small&ownerId=jdyer&avatarId=10500",
"32x32": "https://xxxxxxxx.atlassian.net/secure/useravatar?size=medium&ownerId=jdyer&avatarId=10500",
"48x48": "https://xxxxxxxx.atlassian.net/secure/useravatar?ownerId=jdyer&avatarId=10500"
},
"displayName": "John Dyer",
"active": true
},
"attachment": [],
"customfield_10202": null,
"customfield_10500": null,
"aggregatetimeestimate": null,
"customfield_10807": null,
"customfield_10808": null,
"customfield_10805": null,
"customfield_10806": null,
"customfield_10700": null,
"customfield_10400": "7608",
"customfield_10809": null,
"timeestimate": null,
"customfield_10300": null,
"customfield_10800": null,
"customfield_10803": null,
"customfield_10804": null,
"customfield_10801": null,
"aggregatetimespent": null,
"customfield_10802": null
}
}
I am unable to get the JIRA integration to work... I have confirmed the URL is able to curl the rest api w/ the credentials provided. Unfortunately the apps logging doesnt give me much to go on... Pretty much the only error I see is a 404 in the browsers console logs
Is there something more the jira integration that I am maybe missing ?