我正在使用Excel-VBA并尝试创建一个包含两个自定义字段(Epic-Name和Budget)的史诗,但不知何故它不起作用。创建没有自定义字段的任务可以正常工作。 这是VBA(但我不认为确实存在问题
Public Function CreateEpic(ByVal summary As String, ByVal description As String, ByVal project As String, ByVal budget As String, ByVal dueDate As String) As String
Dim issueType As String
issueType = "Epic"
Dim text As String
text = "{""fields"": {""project"":{ ""key"": """ & project & """},""summary"": """ & summary & """,""description"": """ & description & """,""issuetype"": {""name"": """ & issueType & """},""customfield_12335"":""" & budget & """, ""duedate"":""" & dueDate & """,""customfield_12932"":""" & summary & """}}"
Dim resp As Object
Set resp = HttpRequest("POST", "/rest/api/latest/issue", text, True, True)
MsgBox (text)
CreateEpic = resp("key")
End Function
这里是JSON(来自消息框的输出)
{
"fields":
{
"project":{
"key": "PROJTEST"
},
"summary": "testepic1",
"description": "testepic01",
"issuetype": {
"name": "Epic"
},
"customfield_12335":"100h",
"duedate":"2020-11-1",
"customfield_12932":"testepic1"
}
}
错误回复告诉我这两个自定义字段存在问题,但我不明白这一点。
答案 0 :(得分:0)
解决。代码有效,它只是纯粹的愚蠢(自定义字段的错误ID)