Community moderators have prevented the ability to post new answers.
i find the method getProjectObject() which can get project object according to issue.but now the problem is how to get the "current issue object"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i've get it,
import com.opensymphony.user.User import com.atlassian.jira.security.JiraAuthenticationContext import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.IssueManager import org.ofbiz.core.entity.GenericValue import com.atlassian.jira.project.ProjectManager import com.atlassian.jira.project.Project FormField formField = getFieldById("resolution") FormField comField = getFieldById("comment") ComponentManager componentManager=ComponentManager.getInstance() User user = componentManager.getJiraAuthenticationContext().getUser() String curruser=user.getFullName() IssueManager issueManager=componentManager.getIssueManager() GenericValue issue=issueManager.getIssue("TEEE-5") def projectid=issue.project ProjectManager projectManager=componentManager.getProjectManager() Project project=projectManager.getProjectObj(projectid) def projectlead=project.getLeadUserName() comField.setFormValue("current user is :"+curruser+" current issue is:"+projectlead)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This will fail in jira5. If you don't use static typing here you won't have any problems when you upgrade. So instead of "User user" just use "def user", and remove the import for User.
You should think about this... you will upgrade at some time and the last thing you will want is having to revisit all your old code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Jamie,
I am unable to hide a cutom field which is of the type "Checkbox" using Behaviours plugin . My Jira version is jira 4.2.4 .The field is present in both the create and edit screen .What could be going wrong? Its a simple hide function without any condition added or validation added.
Thanks,
Srividhya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello. Not sure why you are answering a completely different question with this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
I am not answering the question , since you are the developer of the plugin , I just wanted to ask you why the checkbox field is not hidden , when we are saying field.setHidden(true) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please create a new question including all relevant info.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this
def issueId = formContents["id"]
def issue = componentManager.getIssueManager().getIssueObject(issueId as Long)
This will fetch "Issue " Object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Easier to use getUnderlyingIsse() which will fetch the issue object.
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.