Hi Team,
I have a scenario like, from JIRA I need to connect to a remote windows machine and read a list of files in a Folder like below it exists. I need to read all the file anmes and disply in a JIRA cusotm field dropdown. Please assist me how to connect from JIRA to remote wondows machine and read these files names?
I am working with Devender, basically we are working on project where we have need to add custom field in jira with version number. we have shared path as mentioned above in which folders describing the version numbers. We have to access folder name and show it in dropdown as version number. this is requirement. we are not able to access this folder maybe because its on shared path. Do you know how to access it?
Welcome to the Atlassian Community!
I can think of three ways to do this, but all of them depend on knowing how you are sharing the "shared" directory. If you cannot access it, there's nothing you can do.
Two of them are going to need you to write an app, not just a script, and the third is going to require you to code something externally (but nothing complex, and Scriptrunner can do all the work inside Jira pretty much off-the-shelf)
They all need to know exactly how the directory is shared, and the apps will require extra libraries to enable the file system reads.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you exposing the file's directory to the network?
You're going to need to write something that can do a "dir" on that shared directory, get the list of file names, and drop it either into the options for a custom field, or into a database so you can use a database-picker field to draw it in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using below script and getting this error; An error occurred, the field will have no value
Script:-
import groovy.io.FileType
def list = []
def dir = new File("\\..../...APPS/..P01/..Setup/...Releases/..Main System/")
dir.eachFileRecurse (FileType.FILES) { file ->
list << file
println "Hello"
}
==================================
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your script appears to be referring to a local file, that's not going to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please share me the code snippet which can be useful in my scenario?
Thank you,
Dev G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can't - you need to refer to your files via a listing of their network share locations, not a local file location, and I can't know what you've set up!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have a working script for 2 different shared paths like shown below.
Line (7) , is obsolutley working fine but line (5) is not working where code is same .
Please @Nic Brough -Adaptavist- , help me on this issue, its blocking my deleverables form long time.
Note:-Same shard path is working using Python but nit with this Groovy in JIRA
Thank you in advance,
Dev G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That doesn't look like a valid path to the JVM. Not that it's an incorrect string for the path, but it's not shared with the server, so it can't read from it.
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 @Nic Brough -Adaptavist,
My requirement is "Using JIRA scriopt runner, how can I access a shared folder/files on windows network?".
Then I need to read all the files names and get the list and display on JIRA cusotm filed.
Thank you,
Dev G
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.