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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SIL Update Custom field based on value of another Custom field

Hello! I am trying to write a custom SIL post-function script to update the value of a custom single-select field I have based on the values selected in two other custom single select field. 

Here is the scenario. When a user creates a bug, they must select an Urgency and an Impact level (options are High, Medium, and Low). I want to use their selection here to determine the Severity Level of the bug (options are S1, S2, S3, S4). 

EX: User selects Impact = "High" and Urgency = "High" then the Severity Level should be "S1". 

The Severity Level field should be updated based on the selection on the two dropdowns as a Post Function on the Create Transition of the issue. 

Here is my code I started with just to see if I could get this simple case to work first:

if(customfield_10864 == "High" and customfield_10863 == "High")
{
customfield_10865 = "S4";
}

 When I create a bug and select High and High, the Severity level is not getting set to anything- its just null. Code checks out and I have it listed as the last post function in the list. "S4" is the text of the option for the Severity Level dropdown.

What am I doing wrong? Why is the severity level dropdown not updating to the "S4" option?

2 answers

1 accepted

0 votes
Answer accepted

Turns out that the post function was working correctly, it just took a minute before I was able to see the value returned in the dropdown on the issue. It is working now. 

0 votes

Hello!

Could write your script like this:

if(customfield_10864 == "High" and customfield_10863 == "High")
{
runnerLog("inside the if");
customfield_10865
= "S4";

runnerLog(customfield_10865);
}

Then run this script in the SIL Manger. Before running the script, please provide the issue context in the Run Configuration menu. As the issue context you should insert the issue key on which you think this post function should work.

Then have a look at the output of the script.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

5 mobile apps for Jira Cloud to boost productivity

  It’s very important to have access to the workflow process from anywhere. Especially if you manage the work of others. There is no difference whether you’re out of office, or drive a ca...

268 views 2 5
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