Hi ,
Can someone help me figure out if the belowscript is fine. I basically need to append the issue id to the URL “Session Expired”
I have created a custom field called “CRM ticket URL” and here i need to have the above URL with the issue key at the end.
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.customfields.option.LazyLoadedOption
Issue issue = issue
final String crm=“CRM Ticket URL”
def customFieldManager = ComponentAccessor.customFieldManager
def issueKey = issue.getKey()
def s = customFieldManager.getCustomFieldObjects(issue).findByName(crm)
def cnt=issue.getCustomFieldValue(s)
log.debug(cnt)
//getCustomFieldValue(s)
if(cnt){
String url = “Session Expired” + issueKey;
return “<a href="” + url + “">” + url + “”;
}
else{
return ‘-’;
}