首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >有没有办法使用JSON在Jira中添加内部注释?

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

Stack Overflow用户
提问于 2019-05-29 20:44:10
回答 1查看 700关注 0票数 2

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

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

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

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

到目前为止,我已经用JSON代码尝试了一些不同的东西,但我对JSON一点也不熟悉,也不能理解如何区分公共/外部注释和私有/内部注释。我已经将注释添加到了转换过程中添加注释的位置,然后自动化成功运行,但问题是,当我们需要内部注释并仅对服务台用户可见时,此注释会变成外部注释。

代码语言:javascript
运行
复制
   {
        "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,看看它是什么样子,这是我得到的:

代码语言:javascript
运行
复制
    "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,这可能会实现我想要做的事情。

谢谢!

EN

Stack Overflow用户

发布于 2019-05-30 13:44:55

我不确定如何使用JSON来做到这一点,但您应该能够在他们的GUI中做到这点。

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

Ref : Rule Playground

您只需创建一个虚拟规则并对该规则执行export操作即可获得JSON。

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

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56360981

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档