Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

set security for parent issue so assignee of child issue can view the issue .

Umar Maroof
Contributor
April 6, 2023

Hello everyone. 

I am trying to set the issue security for an epic so that epic can be visible to the assignees of the child tasks under the epic.

and whenever the assignee changes for the task the new assignee now can be able to view the parent epic and the pervious assignee unable. How can I achieve this please help me in this.

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2023

Hello @Umar Maroof 

Are you working with issues in a Company Managed project or a Team Managed project?

If a Company Managed project, then per the Issue Security documentation

A security level's members may consist of:

  • Individual users

  • Groups

  • Project roles

  • Issue roles such as 'Reporter', 'Project Lead', and 'Current Assignee'

  • 'Anyone' (eg. to allow anonymous access)

  • A (multi-)user or (multi-)group picker custom field.

There is no option to directly base the security level membership on information in a related issue.

I think you could work around this by

- having a multi-user picker field in the Epic

- using automation rule(s) to add/remove the Assignee of the Epic's child issues to the multi-user picker field of the Epic

- In the Security Level applied to the Epic, add the multi-user picker field.

I work with a Jira Free instance where I can't configure issue security schemes, so I have not had an opportunity to test out the above work around.

Umar Maroof
Contributor
April 6, 2023

@Trudy Claspill yeah exactly I am also thinking about the multiuser field idea for that in automation how pollute the assignees in multifield pickers ?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2023

Here are three posts that talk about modifying a multi-user picker field.

https://community.atlassian.com/t5/Jira-Service-Management/Add-an-aditional-User-to-User-Picker-Multi-with-Automation/qaq-p/1554412

https://community.atlassian.com/t5/Jira-Software-questions/How-to-append-a-user-to-a-multi-select-user-field-in-Jira/qaq-p/1995845

https://community.atlassian.com/t5/Jira-questions/Automation-for-Jira-JSON-update-multi-user-picker/qaq-p/2185010

To add a user to such a field you are going to have to use the More Options option in the Edit Action, and add the users using JSON code.

The rule would need to be triggered by a change to the child issue Assignee field (Issue Field Updated trigger)

You would need to create a Branch/Related Issues/Epic (Parent) to "navigate up" to the Epic you want to modify.

Then you would put the Edit Action within that branch. To get the assignee from the child issue that triggered the rule you would need to reference {{triggerIssue...}} as mentioned in the first post I linked above.

The trickier part will be remove the Assignee that was removed from the child issue. To find that person you will have to look at the {{fieldChange}} object immediately after the trigger, and get the original value of the Assignee field.

Umar Maroof
Contributor
April 6, 2023

@Trudy Claspill I try to call assignee of the child but in below jason it call per user so what should I change so I can call the assignees of child?

{
"update": {
"customfield_xxxxx" : [
{
"add": {
"accountId" : "yyyyy"
}
}
]
}
}
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2023

Please show us the rule you have constructed.

And the first post link I provided shows how to reference a field in the child issue, if it was an event in the child issue that triggered the rule.

Umar Maroof
Contributor
April 6, 2023

Screenshot (30).png

Umar Maroof
Contributor
April 6, 2023
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 6, 2023

The first post link I provided shows how to reference the Assigned field in the child/trigger issue.

Umar Maroof
Contributor
April 9, 2023

@Trudy Claspill 

{
"update": {
"customfield_10195": [
{
"add": {
"id": "{{childIssue.fields.assignee.accountId}}"
}
}
]
}
}

but it give following error

MDP-325 (Field 'customfield_10195' cannot appear in both 'fields' and 'update')

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 10, 2023

Have you shown us everything that is in your Edit action? 

Looking at the second to last response on the first post I linked, it seems like the JSON code should look like this:

{
"update":{
"customfield_10195": [{
"add" : { "accountId" : "{{triggerIssue.assignee.accountId}}" }
}]
}
}

Umar Maroof
Contributor
April 10, 2023

Screenshot (31).pngScreenshot (32).png

Umar Maroof
Contributor
April 10, 2023

@Trudy Claspill above the rule with audit log see the error is still there

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 10, 2023

The problem is that you have specified the field to set in both the JSON code and in the Choose Fields to Set section above the JSON code.

Screen Shot 2023-04-10 at 11.15.58 AM.png

 

You can't have the field in both the Choose fields section and in the JSON code.

You need to click on the Choose fields to set pull down and uncheck the copy tasks assignee users in marketing field. In my example I have the Assignee field selected.

Screen Shot 2023-04-10 at 11.18.04 AM.png

Umar Maroof
Contributor
April 10, 2023

@Trudy Claspill thankyou so much its working fine 

But what about the other condition if I unassigned the user from the task the user will remove from the field can you help me with that as well 

Umar Maroof
Contributor
April 10, 2023

@Trudy Claspill 

{
{% if fieldChange.Assignee is not empty %}
"update":{
"customfield_10195": [
{
"remove" : {
"accountId" : "{{fieldChange.Assignee.accountId}}"
}
}
]
}
},
{
"update":{
"customfield_10195": [
{
"add" : {
"accountId" : "{{triggerIssue.assignee.accountId}}"
}
}
]
}
}
{% else %}
{
"update":{
"customfield_10195": [
{
"add" : {
"accountId" : "{{triggerIssue.assignee.accountId}}"
}
}
]
}
}
{% endif %}
}

 

I am trying this but not working in both cases 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 10, 2023

I've been thinking more about this scenario.

I think adding and removing user individually based on the change of a single child issue is the wrong way to go. Here's why I think this.

Let us say you have Epic ABC-1. It has two child issues; ABC-2 and ABC-3.

ABC-2 and ABC-3 are both assigned to User1. User1 is added to the multi-user picker field in Epic ABC-1.

Then, the Assignee on ABC-3 gets changed from User1 to User2.

User2 appropriately gets added to the multi-user picker field in Epic ABC-1.

User1 is still assigned to another child issue, so you don't really want User1 removed from the multi-user picker field simply because User1 is no longer assigned to ABC-3.

I think the rule needs to be change to not make changes based only on the child issue that triggered the rule. Instead, the rule needs to look at all the child issues as a group, collect the list of all the Assignees on all the child issues, and reset the multi-user picker field on the parent Epic entirely based on the new list of all child issue assignees. 

I have not had time to work out the details of how to do that.

Umar Maroof
Contributor
April 11, 2023

@Trudy Claspill Thankyou for your help yeah, I am stuck in the 2nd condition I also don't know how I can I achieve that.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events