Open Sledav opened 8 years ago
I found an error. I replaced all occurrences of "[R-" with "[#" (#44) . When I cancelled my changes, it works fine. Can You fix it?
In IssueServiceImpl.js, line 1683, relies on a prefix length of 3 letters before the issue number. If you want to use a 2 letter prefix, you have to edit this line:
function injectIssueIdIntoMailSubject(subject, iss) {
...
else {
var p = subject.indexOf("[#");
if (p >= 0) {
var q = subject.indexOf("]", p + 2); /// ----- line 1683: replace p+3 with p+2
if (q >= 0) {
ret = subject.substring(0, p);
ret += subject.substring(q + 1);
}
}
}
I changed it, but AddIn doesn't work correctly. It inserting "[R-" instead "[#". See my files IssueServiceImpl.js and log file. FILES.zip
You're right. The modification above is not sufficient for showing existing issues. Unfortunately, this functionality uses a hard-coded prefix internally. To workaround this, go through the following steps.
replace this function with:
function extractIssueIdFromMailSubject(subject) {
if (islfine) log.log(Level.FINE, "extractIssueIdFromMailSubject(" + subject);
var issueId = "";
var startTag = "[#";
var p = subject.indexOf(startTag);
if (p < 0) { // workaround: extract ID after original prefix
startTag = "[R-";
p = subject.indexOf(startTag);
}
if (p >= 0) {
var q = subject.indexOf("]", p);
if (islfine) log.log(Level.FINE, "found " + startTag + " at " + p + ", ] at " + q);
if (q >= 0) {
issueId = subject.substring(p + startTag.length, q);
}
}
else {
p = subject.indexOf(" #");
if (p >= 0) {
if (islfine) log.log(Level.FINE, "found # at " + p);
p += 2;
var q = p;
for (; q < subject.length; q++) {
var c = subject.charAt(q);
if (isNaN(parseInt(c))) break;
}
if (islfine) log.log(Level.FINE, "last number at " + q);
if (q > p) {
issueId = subject.substring(p, q);
}
}
}
if (islfine) log.log(Level.FINE, ")extractIssueIdFromMailSubject=" + issueId);
return issueId;
};
Thanks, now it's work.
When I enter the Issue ID, and press the button "Show", Addin does not show the Issue. Before click: After click The Issue is exist
Please? fix it.