Hello All,
I have set default text in Description field by adding below script in the behaviour intialiser. I have added mapping to one project and only one issue type:
def desc = getFieldById("description") def defaultValue = """Example Text """ if (getActionName() == "Create"){ desc.setFormValue(defaultValue) } else { }
It is working fine but when i selecting other issue types in the same create screen it is populating the default text in all issues. I want to populate the default text only for one issue type.
Any help?
Thanks in advance,
Bunty
Actually, @Fabio Racobaldo _Herzum_ setting the mapping will not clear the default text.
Think of manual changes, if you type some description, then change issue type, the text you typed will still be present in the form.
Your second option, or leaving all issue type mapped and clearing or entering the default text based on the issue.
I think the issue manager is not needed in this case. You already have the issueContext in the binding. Plus, at creation, there is no underlyingIssue during the create step.
You can get the issue type with issueContext.issueType.name
@Bunty we have several projects that have a default description just for one issue type. I simply accept the fact that users will have to clear/replace the default description. That's never been an issue.
Hi @Bunty ,
you have two options to do that :
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
IssueManager im = ComponentAccessor.getIssueManager();
Issue i = im.getIssueByCurrentKey(underlyingIssue.key);
def issuetypename = i.getIssueType().getName();
...
YOUR CODE
...
The first one is immediate.
Ciao,
Fabio
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.