def bot_bugzilla_get_saved_search(cls, botmessage, context): try: userid = botmessage.user.userid if (not BotCommands.check_ldap_username(context, userid)): return "Set LDAP username first using /setLDAPUsername <LDAP username>" bugzillaHelper = BugzillaHelper() return bugzillaHelper.getSavedQueries(BotCommands.get_ldap_username(context, userid)) except Exception as e: return str(e)
def bot_bugzilla_get_description(cls, botmessage, context): try: userid = botmessage.user.userid if (not BotCommands.check_pr(context, userid)): return "Set PR first using using /setPR <PR number>" bugzillaHelper = BugzillaHelper() return bugzillaHelper.getUpdate0(BotCommands.get_pr(context, userid)) except Exception as e: return str(e)
def bot_bugzilla_get_summary(cls, botmessage, context): try: bugzillaHelper = BugzillaHelper() userid = botmessage.user.userid if (not BotCommands.check_pr(context, userid)): return "Set PR first using /setPR <PR number>" return bugzillaHelper.getSummary(BotCommands.get_pr(context, userid)) except Exception as e: return str(e)
def bot_bugzilla_post_comment(cls, botmessage, context): try: userid = botmessage.user.userid if (not BotCommands.check_pr(context, userid)): return "Set PR first using using /setPR <PR number>" if (not BotCommands.check_comment(context, userid)): return "Set comment first using using /setComment <comment>" bugzillaHelper = BugzillaHelper() bugzillaHelper.addComment(BotCommands.get_pr(context, userid), BotCommands.get_comment(context, userid)) return "Comment successfully posted." except Exception as e: return str(e)