Hello there,
In my Jira workflow, I'm using the JMWE plugin validator for Sub: Task issue type (Field Required Validator). In this, I'm only making the "Time Spent" field required for particular groups, which means that only those group members need to fill out the "Time Spent" field.
And I configured this condition, and it works perfectly; see the condition below.
issue.get("issuetype")?.name == "Sub: Task" && (ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple1") || ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple2") || ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple3"))
But I need to make a minor change to this condition so that the "Time Spent" field in Sub:Task is only required when parent is Story type."
And I tried configuring the script below, but it didn't work. Please assist me in resolving this issue where I'm missing a step and I'm not a script specialist. Please guide me on this and your help appreciated.
(issue.get("issuetype")?.name == "Sub: Task" && parentIssue.get("issuetype")?.name == "Story") && (ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple1") || ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple2") || ComponentAccessor.getGroupManager().isUserInGroup(currentUser, "Siva Apple3"))
Thanks,
Siva.