You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I have written a script condition for fast track transition an issue post function, according to which , if the value of a custom field changes , then the transition is done to another stage.
Have 2 queries:
1) Script is running successfully, (No Failure found in last 6 executions), but the transition could not occur.
2) Could not find the logs in catalina.out .
Please assist
PFB the script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueImpl
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
boolean status = false
IssueManager issueManager = ComponentAccessor.getIssueManager()
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField = customFieldManager.getCustomFieldObjectByName("field name 1")
String producttype = (String) issue.getCustomFieldValue(myCustomField)
IssueManager issueManager1 = ComponentAccessor.getIssueManager()
CustomFieldManager customFieldManager1 = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField1 = customFieldManager1.getCustomFieldObjectByName("field name 2")
String distribution = (String) issue.getCustomFieldValue(myCustomField)
if (producttype.equalsIgnoreCase("Approved") || producttype == null)
{
status=true
}
if (distribution.equalsIgnoreCase("Approved") || distribution == null)
{
status=true
}
return status
Hello,
Add logging to your script and have a look at the logs in the atlassian-jira.log file. Here is the info how you can find the log file:
https://confluence.atlassian.com/adminjiraserver073/logging-and-profiling-861253813.html
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueImpl
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
boolean status = false
IssueManager issueManager = ComponentAccessor.getIssueManager()
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField = customFieldManager.getCustomFieldObjectByName("field name 1")
String producttype = (String) issue.getCustomFieldValue(myCustomField)
IssueManager issueManager1 = ComponentAccessor.getIssueManager()
CustomFieldManager customFieldManager1 = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField1 = customFieldManager1.getCustomFieldObjectByName("field name 2")
String distribution = (String) issue.getCustomFieldValue(myCustomField)
log.error("producttype: ${producttype}")
log.error("distribution: ${distribution}")
if (producttype.equalsIgnoreCase("Approved") || producttype == null)
{
status=true
}
if (distribution.equalsIgnoreCase("Approved") || distribution == null)
{
status=true
}
return status
Hi @Alexey Matveev, thanks for the response. All these changes are already there in my Jira. I have some behavior scripts too, the logs for which I am able to see, but not this script.
Also the script is not working.
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.