Hello,
I have added a custom text field to jira called sync and populated with a simple string 1234. I need to be able to get that value (1234) in java so I can use it to do a rest call. my question is how can I get that customfield details of the current issue im on in?
You mean with groovy script using the Jira API, right? If that so, you can do it like this:
com.atlassian.jira.component.ComponentAccessor<br>import com.atlassian.jira.issue.MutableIssue<br>import com.atlassian.jira.issue.fields.CustomField<br><br>def issueManager = ComponentAccessor.getIssueManager()<br>def issue = issueManager.getIssueObject("TEST-5")<br><br>def customFieldManager = ComponentAccessor.getCustomFieldManager()<br>def customfield = customFieldManager.getCustomFieldObjectByName("Testing")<br><br>return<span> </span>issue.getCustomFieldValue(customfield)import
com.atlassian.jira.component.ComponentAccessor<br>
import
com.atlassian.jira.issue.MutableIssue<br>
com.atlassian.jira.issue.fields.CustomField
<br>
def issueManager = ComponentAccessor.getIssueManager()<br>
def issue = issueManager.getIssueObject(
"TEST-5"
)<br><br>def customFieldManager = ComponentAccessor.getCustomFieldManager()<br>def customfield = customFieldManager.getCustomFieldObjectByName("Testing")<br><br>return<span> </span>issue.getCustomFieldValue(customfield)
Regards,
Elifcan
Hello!
thanks for the reply! I actually using java with jira api but I will try and convert this to java and give it a try will update you with result
@Elifcan Cakmak Hi, How to get customfield value using Java code?
It looks like you're new here. Sign in or register to get started.