是否可以使用JSON在Jira中添加内部注释?

时间:2019-05-29 12:44:10

标签: json automation jira

我正在我公司的Jira Service Desk项目上工作,我们在一些工作流程自动化方面遇到了麻烦。当前,要从步骤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之后,这就是我得到的:

我可以使用“有争议的评论”操作创建规则,并将其保留为内部注释。之后,我导出了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,就可以完成我想做的事情。

谢谢!

1 个答案:

答案 0 :(得分:0)

我不确定如何使用JSON进行操作,但是您应该可以在其GUI中进行操作。

Comment on issue操作中,在More options -> Service Desk下,您应该看到Share with customer的复选框。

Ref : Rule Playground

您只需创建一个虚拟规则,然后export即可获取JSON。

PS:他们的support也应该很好。

相关问题