Hey, guys!
Is it possible to hide or prevent editing "Epic Link" column when editing issue, but allow to set "Epic Link" when creating issue? This rule should be applied just for issues which have "Epic Link".
I have a chance to use ScriptRunner.
Hello @zaharovvv_suek_ru
You can use ScriptRunner Behaviours for this
Add-ons -> Behaviours - Add
Add mapping to your project and issue types
Fields -> Add -> Epic Link
Add server-side script on that field
if (getActionName() != "Create") {
getFieldById(getFieldChanged()).setHidden(true)
}
It will be looks like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mark Markov Thank you very much for your reply!
I've forgot to say that this should applied just for issues which have "Epic Link".
I've tried to use the following code:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link');
def epic = issue.getCustomFieldValue(epicLink);
if (getActionName() != "Create" && epic) {
getFieldById(getFieldChanged()).setHidden(true)
}
However, I see the error: The variable [issue] is undeclared.
How can I check whether there is an 'Epic Link' ?
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Because behaviours doesnt have issue variable.
Try to use
def epic = underlyingIssue.getCustomFieldValue(epicLink);
instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very, very, very much! It worls like a charm!
The full code looks like this:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link');
def epic = underlyingIssue.getCustomFieldValue(epicLink);
if (getActionName() != "Create" && epic) {
getFieldById(getFieldChanged()).setHidden(true)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You re welcome :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @zaharovvv_suek_ru
You have to customize the screen scheme definition. Basically make sure that "Epic link" field is available on create and view screen and not present on edit screen.
Please read the docs here as to how you can create screen scheme and map it with issueType
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply! I'm sorry I've forgot to say that this should applied just for issues which have "Epic Link". Thanks in advance.
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.
Hi!
Yes, it is possible. You should edit the Screen Scheme associated with the project to make 2 different screens for edit and view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This article should help to understand this operation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply! I'm sorry I've forgot to say that this should applied just for issues which have "Epic Link". Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. I see. You're welcome!
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.