Hello,
We have a scripted custom field which is calculated depending on values in other custom fields. For sub-task it inherits the value from parrent issue.
code looks like this:
if (issue.issueTypeObject.name == "Sub-task") { def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Total Score") def abc123 = issue.parentObject.getCustomFieldValue(field); return abc123 } else { count the value return value }
I want to ask is it somehow possible for linked issues to inherit value of this scripted field? If the value is updated in "main" task it should by updated in all linked issues. Does anybody have a solution for this?
if (issue.issueTypeObject.name == "Sub-task") { def inwardIssues = ComponentAccessor.getIssueLinkManager().getLinkCollectionOverrideSecurity().getInwardIssues("Parent Of"); if(inwardIssues.size() == 1) { def parent = inwardIssues[0]; def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Total Score") def abc123 = parent.getCustomFieldValue(field); return abc123 } else { count the value return value } }
Note I haven't tested the code, so it might require a little tune-up
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can't you use simular code that checks if the issue has inward link of some type then get the value from the linked issue ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you put here an example how can I check the inward links and then get the value?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.