Closed Office-Manager closed 7 years ago
Note that HUBOT_JIRA_USERNAME should be the JIRA username, this is not necessarily the username used if you log in via the web. To determine a user's username, log in as that user via the web, and check the user profile. Frequently, users may log in using an email address such as 'bob@somewhere.com' or a stem, such as 'bob'; these may or may not match the username in JIRA.
Thanks @mchennamsetty , I've tried it making sure the user is the one which logs in and appears in the profile username but still to no success :/
Ah I see the problem here....
So behind the scenes as its trying to format the output its trying to resolve the jira user whom reported the issue into the equivalent chat user. This integration is used heavily with hubot-slack
where there is a email address field that is expected to be the same between the chat and jira users. However since you are using a Shell instead of hubot-slack
adapter the field isn't there and there isn't a guard to protect against it.
Happy to accept pull requests to fix the issue, I suspect some ?
existence checks here: https://github.com/ndaversa/hubot-jira-bot/blob/master/src/utils.coffee#L62
Would resolve the issue
Let me know if that works for you locally and maybe, if you are so inclined, you can get a PR together?
@ndaversa - I've found out the issue in the code too, just have no ideas for fixing it. Can we do a check other than looking for the email address? The point is, that the email address is defined in Jira for each user so it should work.
@ndaversa: seems I made it working changing the code as per the following:
@lookupUserWithJira: (jira, fallback=no) -> users = Utils.JiraBot.adapter.getUsers() result = (users[user] for user of users when users[user].name is jira.name) if jira if result?.length is 1 return if fallback then result[0].name else "<@#{result[0].id}>" else if jira return jira.displayName else return "Unassigned"
It now gets the correct value, although I think you need something else here. Can you please check and maybe update your code?
Hi ,
Noticing an issue when trying out the hubot with our JIra instance ( self hosted if that makes a difference)
Added some debugging to see what it's seeing and what's being sent.
which outputs
Any ideas on what could be the issue? I can confirm the username and password are working on the instance