Label with 'jira_' at the beginning gets added then instantly removes itself

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

If you are using Zendesk in conjunction with JIRA, and a label starts with "jira_" (thats JIRA, immediately followed by an underscore), any text added after the underscore, will be added but immediately removed.  

As an example, anything that starts with "jira_" seems to vanish:

  1. Example labels that will produce this behavior:
    1. "jira_test"
      1. 'jira' underscore 'test'
    2. "jira__test"
      1. 'jira' underscore underscore 'test'
    3. "jira_skjdhfksjh"
      1. JIRA underscore random characters
  2. Example labels that do not produce this behavior: 
    1. "test_jira_" 
    2. "jiratesting"
    3. "testjira_"
    4. "test_akjlsdhgkjsdhf"

When this happens, raise a request with us so that a support engineer can verify whether the following appears in the JIRA log:

2014-08-25 12:05:54.616867500 2014-08-25 12:05:54,616 TP-Processor29 INFO anonymous 725x12828x1 19qzsgh  /rest/api/2/issue/125185 [plugin.module.permission.ApiScopingFilter] Authorized add-on 'zendesk_for_jira' to access API at URL 'GET /rest/api/2/issue/125185' for user 'sysadmin'
2014-08-25 12:05:54.705932500 2014-08-25 12:05:54,705 TP-Processor29 INFO anonymous 725x12829x1 19qzsgh  /rest/api/2/issue/125185 [plugin.module.permission.ApiScopingFilter] Authorized add-on 'zendesk_for_jira' to access API at URL 'PUT /rest/api/2/issue/125185' for user 'sysadmin'

Then Wait a few seconds and the following will appear (4 seconds in this example, but consistently < 6 seconds while testing)

2014-08-25 12:05:58.063553500 2014-08-25 12:05:58,063 TP-Processor29 WARN sysadmin 725x12830x1 19qzsgh  /rest/analytics/1.0/publish/bulk [analytics.client.browser.PublisherResource] BrowserEvent property values should not be Collections or Maps. name=kickass.inlineEdit, properties={issueId=125185, savedFieldIds=[labels], duration=571, context_pageSession=uayh5qcdpvipmn293t8ry2yrov8cl3di, context_pageTime=872625}

Refresh the page, the label will disappear and the following will appear:

2014-08-25 12:06:03.772351500 2014-08-25 12:06:03,771 TP-Processor15 INFO anonymous 726x12864x1 19qzsgh  /rest/api/2/issue/125185 [plugin.module.permission.ApiScopingFilter] Authorized add-on 'zendesk_for_jira' to access API at URL 'GET /rest/api/2/issue/125185' for user 'sysadmin'
2014-08-25 12:06:03.889294500 2014-08-25 12:06:03,889 TP-Processor15 INFO anonymous 726x12865x1 19qzsgh  /rest/api/2/issue/125185 [plugin.module.permission.ApiScopingFilter] Authorized add-on 'zendesk_for_jira' to access API at URL 'PUT /rest/api/2/issue/125185' for user 'sysadmin'

 

Diagnosis

Additionally, support can enable SQL debugging and run various commands so that we can further determine what's occurring on the back end:

tail -f atlassian-jira-sql.log | grep 'INSERT\|DELETE' | grep -v ServiceRunner
2014-08-25 21:38:36,162 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 2ms "DELETE FROM public.label WHERE FIELDID IS NULL AND ISSUE='125185'"
2014-08-25 21:38:36,163 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 1ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23340', 'null', '125185', 'Wishlist')"
2014-08-25 21:38:36,164 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 1ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23341', 'null', '125185', 'test_jira')"
2014-08-25 21:38:36,165 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 1ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23342', 'null', '125185', 'test_jira_test')"
2014-08-25 21:38:36,166 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 1ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23343', 'null', '125185', 'jira_ach_payments')"
2014-08-25 21:38:36,169 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 1ms "INSERT INTO public.changegroup (ID, issueid, AUTHOR, CREATED) VALUES ('113905', '125185', 'sysadmin', '2014-08-25 21:38:36.168')"
2014-08-25 21:38:36,169 TP-Processor69 sysadmin 1298x27195x1 1dv5kbd /secure/AjaxIssueAction.jspa 0ms "INSERT INTO public.changeitem (ID, groupid, FIELDTYPE, FIELD, OLDVALUE, OLDSTRING, NEWVALUE, NEWSTRING) VALUES ('165203', '113905', 'jira', 'labels', 'null', 'Wishlist test_jira test_jira_test', 'null', 'Wishlist jira_ach_payments test_jira test_jira_test')"
2014-08-25 21:38:37,723 TP-Processor69 sysadmin 1298x27199x1 1dv5kbd /rest/api/2/issue/125185 1ms "DELETE FROM public.label WHERE FIELDID IS NULL AND ISSUE='125185'"
2014-08-25 21:38:37,724 TP-Processor69 sysadmin 1298x27199x1 1dv5kbd /rest/api/2/issue/125185 0ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23344', 'null', '125185', 'Wishlist')"
2014-08-25 21:38:37,725 TP-Processor69 sysadmin 1298x27199x1 1dv5kbd /rest/api/2/issue/125185 0ms "INSERT INTO public.label (ID, FIELDID, ISSUE, LABEL) VALUES ('23345', 'null', '125185', 'test_jira')"


Finally, support can run various database queries to obtain a before and after perspective: 

Before the label is added:

jira=> select (p.pkey ||  '-' || i.issuenum) as issue, l.label from project p, jiraissue i, label l where p.id = i.project and i.id = l.issue and i.id = 125185;
   issue   |  label
-----------+----------
 BDC-12673 | Wishlist
(1 row)


Immediately after the change:

jira=> select (p.pkey ||  '-' || i.issuenum) as issue, l.label from project p, jiraissue i, label l where p.id = i.project and i.id = l.issue and i.id = 125185;
   issue   |       label
-----------+-------------------
 BDC-12673 | jira_test
 BDC-12673 | Wishlist
(2 rows)


After ~10 - 15 seconds:

jira=> select (p.pkey ||  '-' || i.issuenum) as issue, l.label from project p, jiraissue i, label l where p.id = i.project and i.id = l.issue and i.id = 125185;
   issue   |  label
-----------+----------
 BDC-12673 | Wishlist
(1 row)

 

When disabling the Atlassian Connect Zendesk plugin, the label is no longer deleted, Turning it back on, and it's being deleted again. BUT.. The Zendesk Addon is also throwing errors in the Log when we are Disabling/re-enabling it Which indicates a misconfiguration.  Support will see the following stack trace in the JIRA logs when enabling and disabling the ZenDesk Plugin:

2014-08-25 21:47:10,538 TP-Processor69 ERROR sysadmin 1307x27430x1 1dv5kbd  /rest/plugins/1.0/zendesk_for_jira-key [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Illegal group reference
java.lang.IllegalArgumentException: Illegal group reference
      at java.util.regex.Matcher.appendReplacement(Matcher.java:713)
      at java.util.regex.Matcher.replaceFirst(Matcher.java:861)
      at java.lang.String.replaceFirst(String.java:2146)
      at com.atlassian.jira.ofbiz.OfBizLogHelper.formatSQL(OfBizLogHelper.java:30)
      at com.atlassian.jira.ofbiz.LoggingSQLInterceptor.afterExecutionImpl(LoggingSQLInterceptor.java:67)
      at com.atlassian.jira.ofbiz.LoggingSQLInterceptor.afterSuccessfulExecution(LoggingSQLInterceptor.java:54)
      at com.atlassian.jira.ofbiz.ChainedSQLInterceptor.afterSuccessfulExecution(ChainedSQLInterceptor.java:91)
      at org.ofbiz.core.entity.jdbc.SQLProcessor.afterExecution(SQLProcessor.java:561)
      at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:642)
      at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:192)
      at org.ofbiz.core.entity.GenericDAO.singleStore(GenericDAO.java:381)
[...]


Cause

There is an issue with how Zendesk handles the labels, that treats the underscore after the term jira as an illegal character and removes the label.

Workaround

Remove any labels that use "jira_" tag at the beginning of the label.

File a service Support Request with ZenDesk here: https://marketplace.atlassian.com/plugins/zendesk_for_jira#tabs-support under the Support tab

 

There is a bug to track this on our system located here:  

JRA-40148 - Getting issue details... STATUS

 

 

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.