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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

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

How to populate the list on selecting a specific type of project in tempo?

Hello,

I am trying to populate the project name when a user selects the project type. For example, Project type is A, the dropdown box should list with project names that belong to project type A. Can anybody suggest how to write a script in the scriptrunner so that I can attached that link to work attributes in dynamic dropdown field.

Thanks

Ankini

3 answers

0 votes

Interesting. @Maxime Nie _Tempo_ , any ideas on this one?

0 votes
carolyn french Community Leader Feb 05, 2020

Hi Ankini,

Can you provide screenshots and more details of what you are trying to do, and what you would like to see as an outcome of this? 

thanks,
Carolyn

Hi @carolyn french 

Thanks for looking into my question. Here is the youtube link where I have screen recorded of our company's time tracker and the same thing we would like to replicate in tempo while logging time.

Link: https://youtu.be/K4qrhhR6_I0

So as you can see, we have project types R&D New, R&D Old, Support, etc and on select, those "Type", a list of projects populate under "Project" dropdown and in regards to that "Task" list populates. The same we would like to replicate under log time in tempo using the dynamic dropdown. Not sure exactly how I can do that. If you can guide me with that, it would be great.

Please let me know if you have any questions.

Thanks

Ankini

Hi @carolyn french ,

Any updates with the question?

Looking forward to your response.

Thanks

Ankini 

carolyn french Community Leader Feb 12, 2020

Hi @Ankini_Desai ,

Thanks for that youtube video explanation- clearer now.

Can you by any chance do this at the issue level instead of worklog level? 

@carolyn french 

It is preferred to be done at the worklog level for the accounting purpose in our organization. Trying using script runner but no luck till now.

 

Thanks

Ankini

Hi @carolyn french 

I tried using this script. But still getting "no results found" in the dropdown. Can you please give it a look. 

Under the logs section, I am getting null. So I believe something is wrong with issue and issueKey. Also, I have attached a screenshot showing that I am unable to get the data in my dropdown. Could you please help me here?

API URL:-http://jira.mjappliedtech.com:8100/rest/scriptrunner/latest/custom/tempoWorkType

 

import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import groovy.json.JsonBuilder
import groovy.transform.BaseScript
import com.atlassian.jira.component.ComponentAccessor
import javax.servlet.http.HttpServletRequest
import javax.ws.rs.core.MultivaluedMap
import javax.ws.rs.core.Response

@BaseScript CustomEndpointDelegate delegate

def issueManager = ComponentAccessor.getIssueManager()

tempoWorkType(httpMethod: "GET") { MultivaluedMap queryParams, String body, HttpServletRequest request ->
def callbackFn = queryParams.getFirst("callback")
def issueKey = request.getParameter("issueKey")
def options
def issue = issueManager.getIssueObject(issueKey)

if(issueKey!= null){
options = [
values: [
[
key:"",
value:"Please select..."
],
[
key:"Dev",
value:"Development"
],
[
key:"Unit",
value:"Unit Testing"
],
[
key:"QA",
value:"QA Testing"
]
]
]
}
else{
options = [
values: [
[
key:"",
value:"Please select..."
],
[
key:"Err",
value:"Error in Dropdown"
],
[
key:"Issue",
value:"Not Receiving List"
]
]
]
}
def resp = """${callbackFn} ( ${new JsonBuilder(options).toPrettyString()} )""".toString()
return Response.ok(resp).build()
}

Hi @Chander Inguva

I checked your solution for "Connecting to External MS SQL Database from JIRA using Groovy SQL". It worked for me

 Can you please try to look at this issue and if you have any idea about this?

Looking forward to your response.

Thanks

Ankini

Suggest an answer

Log in or Sign up to answer
TAGS

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