How to set Issue security level depending on an Assets object attribute

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

In some scenarios, Jira issues have Assets Custom fields added to screens. You would like to make Jira issues visible only for users which are members of an Assets object attribute.  
Assets
Custom field has a type attribute User.

Here we will share a solution but it will also require some custom scripts.

環境

Assets or Insight Asset Management

ソリューション

The solution includes an issue-level security, Assets Post function and a custom script to be developed by customers.

要件

  1. Create a new 'User Picker' Jira Custom field
    • The field will be populated by the value of your Assets object and it will also be used when selecting the appropriate security level
  2. Add an Issue Security Scheme - Configuring issue-level security
    • When selecting 'Users / Groups / Project Roles' column, you need to select User custom field value and set it to the Jira Custom field created in Step #1
    • Ensure to set issues security permission in the project permission scheme. This permission allows a user to set a security level.
    • You can read more about it here Managing project permissions
  3. Assign the issue security scheme to a project
  4. Until this point, Insight or Assets are not involved in the configuration.
  5. Create an Assets Post function on Create/Update transaction to copy the value of Assets user attribute to the 'User Picker' Jira Custom field so the security level can be set.
    • Insight Post function: Set a Jira custom field with the attribute value from a selected object
    • Source custom field: Your Assets CF 
    • Insight Object Type Attribute name: Object attribute which hold the username
    • Target custom field: The new Jira CF created in Step #1
      Make sure the event occurs before an event called (Class: com.atlassian.jira.workflow.function.event.FireIssueEventFunction) which it's created by default and after (Re-index an issue to keep indexes in sync with the database). If you do not have them, please discard the alert.
  6. When an issue is created, Jira should only display issues to only users included in the 'User Picker' Jira Custom field which should be the same as your Assets CF.

その他

  • The above solution works if users in the Assets Object attributes never get updated.
  • If the Assets-Object attribute gets updated, with the current configuration described in this article, 'User Picker' Jira Custom field value will not get changed and the issue will still be visible to the previous user.
    • A custom script is needed to fetch the Insight CF value (probably username) and then push it to 'User Picker' Jira Custom field value created in Step #1





最終更新日: 2023 年 2 月 20 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.