Hello,
I'm using Power Scripts for Jira with Live Fields.
What I want to do is to rectrict the values of a custom field (let's call it XXX) in the Sub-task creation screen based on the value of a custom field (let's call it YYY) in the "not yet" parent issue ("not yet", because we are in the Sub-task creation screen).
I've created a Main script calling a hook script in case of Sub-task creation screen:
if ( argv["screen"] == "create-subtask" )
{
lfInstantHook("issueType", "hook.sil");
}
My problem is : how to access parent issue custom field XXX value in the hook script (hook.sil) ? (use %parent% doesn't work)
Thanks.
Christophe
Hello Christophe,
This is an interesting question. You can access the key of the parent issue with "key". As you have pointed out, the variable "parent" does not yet exist (normally accessed as "key.parent") because the parent relationship has not yet been established. Your hook script would look something like this:
if (key.customfield_1234 == "option1") {
lfRestrictSelectOptions("name of custom field", {"element2", "element4"});
}
https://confluence.cprime.io/display/JJUPIN/lfRestrictSelectOptions
https://confluence.cprime.io/display/JJUPIN/lfAllowSelectOptions
If you would like to discuss this or other scripts with me, feel free to stop by chat and we will be happy to help out.
Regards,
Hyrum Steffensen
Product Engineer, Power Scripts
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.