I want to set the epic link to an issue key from an other form field (scriptrunner issue picker).
This is no problem so far, but how do I clear the epic link form field, if the other form field is cleared? Empty string, -1 and null are not working.
def epicLink = getFieldByName('Epic Link')
def issuePicker = getFieldByName('Issue Picker')
def issueKey = issuePicker.getValue()
if (issueKey) {
epicLink.setFormValue(issueKey)
}
else {
epicLink.setFormValue('')
}
I thought the approach to use a issue picker field, would be a solution to my original problem.
Is it possible to restrict the epics I can choose in epic link.
I want to restrict the choices depending on the input on that issue. With the issue picker field I found a solution to do that. But I don't want epic link to remain, when I clear issue picker field.
Probably I could do it with the issue picker field and a listener to watch all changes of that issue picker field, but that solution is hard to service if anything goes wrong or needs to be changed.
Hi @Erik Buchholz,
How about passing "null" value to the form field
getFieldByName("Epic Link").setFormValue(null)
This seems to be working for me
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
I removed all other code from my behaviour and tried your code line in field script and initializer script, but in both cases only the text in summary field gets selected but epic link remains.
I see that I have the right field, because with setDescription I can change the description and so on. Only clearing isn't working.
I thought about browser problems, but it's the same in firefox and edge...
Regards,
Erik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mean clearing epic link field value is not working? can you pass me your code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
I used your code to be sure, that there isn't anything disturbing.
getFieldByName("Epic Link").setFormValue(null)
To be sure that I still have the right field I added a discription.
def epicLink getFieldByName("Epic Link").setFormValue(null)
epicLink.setDescription("Test")
The field was read only but I removed that too.
Perhaps I should contact Adapavist support. Perhaps they can see something in the logs or configuration, I don't see.
Regards
Erik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Leo ,
you're right. It should work and it works now. There was a bug with epic link in scriptrunner that is fixed with scriptrunner 6.15. For more information see https://productsupport.adaptavist.com/browse/SRJIRA-2664
Thanks to Adapatvist support for giving me this hint.
Regards
Erik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.