有没有办法使用JSON在Jira中添加内部注释?

有没有办法使用JSON在Jira中添加内部注释?,json,automation,jira,Json,Automation,Jira,我正在从事我公司的Jira服务台项目,我们的一些工作流程自动化遇到了一些问题。当前,要通过工作流从步骤1(等待支持)->步骤2(进行中),用户需要在单击“进行中”按钮后输入注释,以成功将问题移动到下一步 这是预期的工作,但我们希望利用一个自动化规则,也将自动转换问题从步骤1到步骤2,如果评论添加到一个问题。出现此问题的原因是工作流验证程序要求在转换过程中添加注释,以便问题移动到下一个状态 好的是,我们的自动化插件(automation for Jira)确实允许您将JSON配置添加到规则中的步骤

我正在从事我公司的Jira服务台项目,我们的一些工作流程自动化遇到了一些问题。当前,要通过工作流从步骤1(等待支持)->步骤2(进行中),用户需要在单击“进行中”按钮后输入注释,以成功将问题移动到下一步

这是预期的工作,但我们希望利用一个自动化规则,也将自动转换问题从步骤1到步骤2,如果评论添加到一个问题。出现此问题的原因是工作流验证程序要求在转换过程中添加注释,以便问题移动到下一个状态

好的是,我们的自动化插件(automation for Jira)确实允许您将JSON配置添加到规则中的步骤中。例如,我可以添加JSON以在转换期间向规则添加注释,这正是我们想要的。但这里的问题是,评论是发送给客户的外部评论。我们需要将此评论作为内部评论,这样当我们已经有用户联系客户时,不会向客户发送任何不必要的信息

我们试图实现的是将问题置于“等待支持”状态,然后当内部用户对该问题发表评论时,它将使用自动化规则自动转换到下一个状态(进行中)。但由于我们的工作流程要求,我们还需要在转换期间添加额外的内部注释,以使转换有效。我们的工作流程要求我们在从一种状态转换到另一种状态的过程中添加注释,然后才允许更改状态

到目前为止,我已经用JSON代码尝试了一些不同的方法,但我对JSON一点也不熟悉,也没有弄清楚如何区分公共/外部注释和私有/内部注释。我已经将其添加到过渡期间添加注释的位置,然后自动化成功运行,但问题是,当我们需要内部注释且仅服务台用户可见时,此注释将成为外部注释

   {
        "update": {

        "comment": [
    {
        "add": {
        "body": "Issue issue.key has been transitioned to the In Progress 
        status per automation guidelines."

    }

    }
    ]
    }
    }



This is the JSON code that is added at the status transition step that works. Just not 100% the right way. I am trying to somehow figure out a way to have the comment that is added be internal as opposed to external.
我能够使用“对问题发表评论”操作,并模仿我的规则加上附加的内部评论和“对问题发表评论”操作。导出JSON后,我得到的是:

    "cloud":true,
"rules":[
{
"id":188601,
"clientKey":"jira:12205936",
"name":"Incident Comment Transition ",
"state":"ENABLED",
"description":null,
"canOtherRuleTrigger":false,
"notifyOnError":"FIRSTERROR",
"authorAccountId":"5a328efd101d3439bb11039c",
"actorAccountId":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077",
"created":1559219471531,
"updated":1559221244585,
"trigger":{
"id":"3628751",
"component":"TRIGGER",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.issue.event.trigger:commented",
"value":{
"synchronous":false,
"eventKey":"jira:issue_updated",
"issueEvent":"issue_commented"
},
"children":[
],
"conditions":[
]
},
"components":[
{
"id":"3628752",
"component":"CONDITION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.jql.condition",
"value":"assignee != empty and resolution = unresolved and status = \"waiting for support\" and issuetype=\"incident\"",
"children":[
],
"conditions":[
]
},
{
"id":"3628753",
"component":"ACTION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":6,
"type":"jira.issue.transition",
"value":{
"operations":[
],
"advancedFields":"",
"sendNotifications":true,
"useLegacyRendering":false,
"transitionMode":"status",
"destinationStatus":{
"type":"ID",
"value":"3"
},
"transitionMatch":"",
"transition":null,
"ignoreConditions":false
},
"children":[
],
"conditions":[
]
},
{
"id":"3628754",
"component":"ACTION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.issue.comment",
"value":{
"comment":"Issue {{issue.key}} has been moved to the In Progress status per automation guidelines.",
"publicComment":false,
"commentVisibility":null,
"sendNotifications":true,
"addCommentOnce":true,
"useLegacyRendering":false
},
"children":[
],
"conditions":[
]
}
],
"projects":[
{
"projectId":"10610",
"projectTypeKey":"service_desk"
}
],
"labels":[
]
}
    ]
我可以用“评论问题”操作创建规则,并将其作为内部评论。之后,我导出了JSON以查看它的外观,这就是我得到的:

    "cloud":true,
"rules":[
{
"id":188601,
"clientKey":"jira:12205936",
"name":"Incident Comment Transition ",
"state":"ENABLED",
"description":null,
"canOtherRuleTrigger":false,
"notifyOnError":"FIRSTERROR",
"authorAccountId":"5a328efd101d3439bb11039c",
"actorAccountId":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077",
"created":1559219471531,
"updated":1559221244585,
"trigger":{
"id":"3628751",
"component":"TRIGGER",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.issue.event.trigger:commented",
"value":{
"synchronous":false,
"eventKey":"jira:issue_updated",
"issueEvent":"issue_commented"
},
"children":[
],
"conditions":[
]
},
"components":[
{
"id":"3628752",
"component":"CONDITION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.jql.condition",
"value":"assignee != empty and resolution = unresolved and status = \"waiting for support\" and issuetype=\"incident\"",
"children":[
],
"conditions":[
]
},
{
"id":"3628753",
"component":"ACTION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":6,
"type":"jira.issue.transition",
"value":{
"operations":[
],
"advancedFields":"",
"sendNotifications":true,
"useLegacyRendering":false,
"transitionMode":"status",
"destinationStatus":{
"type":"ID",
"value":"3"
},
"transitionMatch":"",
"transition":null,
"ignoreConditions":false
},
"children":[
],
"conditions":[
]
},
{
"id":"3628754",
"component":"ACTION",
"parentId":null,
"conditionParentId":null,
"schemaVersion":1,
"type":"jira.issue.comment",
"value":{
"comment":"Issue {{issue.key}} has been moved to the In Progress status per automation guidelines.",
"publicComment":false,
"commentVisibility":null,
"sendNotifications":true,
"addCommentOnce":true,
"useLegacyRendering":false
},
"children":[
],
"conditions":[
]
}
],
"projects":[
{
"projectId":"10610",
"projectTypeKey":"service_desk"
}
],
"labels":[
]
}
    ]
你能告诉我这部分的哪一部分会添加内部评论吗?我在想,如果我可以在规则的“转换问题”步骤中使用JSON,这可能会完成我想要做的事情


谢谢

我不知道如何使用JSON,但您应该能够在他们的GUI中完成

问题评论
操作中,在
更多选项->服务台
下,您应该看到
与客户共享
的复选框

您只需创建一个伪规则和获取JSON的规则


PS:他们的操作应该也很好。

嗨,John,我已经研究过“对问题发表评论”操作,这里的问题是,该操作将在工作流中的转换步骤之后发生。因此,这不符合工作流要求,仍然会使问题停留在第一个状态。我希望有一种方法可以在自动化中同时执行两件事情,例如转换和问题评论操作同时发生,但还没有完全弄清楚。嗨,John,请参阅我上面关于规则创建和JSON导出的编辑
publicComment:false
似乎是相关行,请尝试在“body”键的同时添加该行。谢谢您的帮助John。在做了一些研究之后,根据Atlassian当前的API限制,似乎不可能在工作流转换的同时执行内部注释。以下是有关此错误的一些问题: