json - 有没有办法使用 JSON 在 Jira 中添加内部评论?
问题描述
我正在处理我公司的 Jira Service Desk 项目,我们在一些工作流自动化方面遇到了一些问题。目前要通过工作流从步骤 1(等待支持)-> 步骤 2(进行中)移动问题,用户需要在单击“进行中”按钮后输入评论才能成功将问题移动到下一步。
这按预期工作,但我们也想利用自动化规则,如果向问题添加评论,它将自动将问题从步骤 1 转换到步骤 2。出现此问题的原因是工作流验证器要求在转换期间添加注释以使问题移至下一个状态。
好消息是我们的自动化插件(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,这可能会完成我想要做的事情。
谢谢!
解决方案
推荐阅读
- c# - 带有 Stringbuilder 的 C#“编码器”
- sql - SQL:选择用户ID,如果一个条目具有特定值,则排除所有用户ID
- azure - 可从 azure Web 应用程序多容器访问的 Docker.sock
- java - 使用 java config 缺少 bean 工厂的 TCP 客户端
- mysql - How to configure a one to many relationship in Sequelize?
- reactjs - 反应超时竞争条件
- hyperledger - 为什么我无法部署超级账本作曲家项目
- oracle - 在 PLSQL 中创建触发器--接收错误消息
- flutter - 如何在颤动中呈现一个空视图?
- java - 如何修复在java中读取文件