Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,681
Community Members
 
Community Events
165
Community Groups

Cant find Script runner Logs(Fast Track Transition an Issue Script Condition)

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

 

2 answers

1 accepted

1 vote
Answer accepted

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 _Appfire_, 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.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

219 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you