Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Hemanshu Sood
Contributor
June 25, 2018

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

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2018

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
0 votes
Hemanshu Sood
Contributor
June 25, 2018

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.

TAGS
AUG Leaders

Atlassian Community Events