We have an existing process in our current JIRA v7.10.2 where we use nFeed Plugin to automatically pull Manager's Username from AD synced DB. ..During creation Transition, Jira Auto-assigns the Tkt to that Username (AD Username is Jira Username too). There are Multiple other actions that happen after the manager gets assigned. Custom email. alerts etc. etc. ... However, recently, after our Jira Server Application got upgraded from JIRA v7.10.2 TO Jira v8.5.3 in our Test env, our Auto-assign Manager script is NOT working there anymore. After Creation, Assignee field only shows this value: {"keys":["username"]} ... The problem seems to be tied to Jira not being able to parse the Username field and associate it to an actual Jira user.
The logs show the error:
- Failed to perform async task: No user exists with the key {"keys":["username"]}
Can anyone suggest me what I need to do to resolve this Please? I am including the script I am using in that Create Issue Transition.
#import com.atlassian.jira.component.ComponentAccessor
from com.atlassian.jira.component import ComponentAccessor
from com.atlassian.jira.user import UserUtils
from HTMLParser import HTMLParser
import com.xhaus.jyson.JysonCodec as json
import sys
# Declare the list. myparse function writes to a global list
htmlData = []
# Used to parse html data. Fields like repsonsibility provide data in html.
class myparse(HTMLParser):
def handle_data(self, data):
if data.strip() != '': # remove white lines
htmlData.append(data.strip())
# Function to parse html fields. Pass the data from the field and it will
# return the value of the field as a list
def parseHtml(data):
htmlField = myparse()
try:
htmlField.feed(data)
tmp = list(htmlData)
except:
tmp = ['']
del htmlData[:]
return tmp
## Define & Get actual value free of html/xml Codes
customFieldManager = ComponentAccessor.getCustomFieldManager()
userManager = customFieldManager.getCustomFieldObjectByName("Manager JIRA name")
userManagerHtml = issue.getCustomFieldValue(userManager)
userManagerValue = parseHtml(userManagerHtml)[0]
issue.setAssigneeId(userManagerValue);