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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
Hi @Ankini Shah ,
Thanks for that youtube video explanation- clearer now.
Can you by any chance do this at the issue level instead of worklog level?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting. @Maxime Nie [Tempo] , any ideas on this one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.