Jira Rest API中如何通过email地址查询用户名



我想根据使用VBA收到的Outlook电子邮件在Jira中创建问题。然而,当通过REST API设置受让人/报告者时,似乎只能通过名称指定用户。当尝试通过电子邮件地址指定用户时,我得到这个错误:

assignee:包含'name'属性的预期对象

下面是不能工作的Json代码:

JSON(0) = "{"
JSON(1) = "  ""fields"": {"
JSON(2) = "    ""project"": {"
JSON(3) = "      ""id"": 23354"
JSON(4) = "    },"
JSON(5) = "    ""summary"": ""@customSubject"","
JSON(6) = "    ""description"": ""@customBody"","
JSON(7) = "    ""issuetype"": {"
JSON(8) = "      ""name"": ""@issueName"""
JSON(9) = "    },"
JSON(10) = "    ""assignee"": {"
JSON(11) = "      ""emailAddress"": ""@assignEmail"""
JSON(12) = "    },"
JSON(13) = "    ""labels"": ["
JSON(14) = "      ""@jiraLabel"""
JSON(15) = "    ]"
JSON(16) = "  }"
JSON(17) = "}"
JSON = getJSON(CustomReplace(OutlookMail.Subject), CustomReplace(OutlookMail.Body), "Ticket", CustomReplace(OutlookMail.SenderName), "")

你知道我怎样才能用电子邮件地址代替名字吗?

正在运行:

JSON(0) = "{"
JSON(1) = "  ""fields"": {"
JSON(2) = "    ""project"": {"
JSON(3) = "      ""id"": 23354"
JSON(4) = "    },"
JSON(5) = "    ""summary"": ""@customSubject"","
JSON(6) = "    ""description"": ""@customBody"","
JSON(7) = "    ""issuetype"": {"
JSON(8) = "      ""name"": ""@issueName"""
JSON(9) = "    },"
JSON(10) = "    ""assignee"": {"
JSON(11) = "      ""name"": ""@assignAlias"""
JSON(12) = "    },"
JSON(13) = "    ""labels"": ["
JSON(14) = "      ""@jiraLabel"""
JSON(15) = "    ]"
JSON(16) = "  }"
JSON(17) = "}"
JSON = getJSON(CustomReplace(OutlookMail.Subject), CustomReplace(OutlookMail.Body), "Ticket", "myusername", "")

使用用户名/电子邮件地址为受让人/记者处理问题的能力在多年前就被弃用了,取而代之的是使用accountid。如果您不知道一个人的accountID,则必须根据其用户名/电子邮件地址进行搜索。

相关内容

  • 没有找到相关文章

最新更新