Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi
I wanted to add user to project whenever project access request is raised
Tried to create a script to match my scenario, However it is bringing me Project ID: [19905]
But I am looking for a project key to pass in addActorsToProjectRole
14805 is an asset custom fields whose scope in asset is objectType = service and in this service object we have an attribute call “JiraKey”, Type: Project, containing all Jira projects in it, Below script:
is bringing project id and I want project key.
Can anyone help?
Details:
We have a Service Request in JSM from where user can raise a request to access Jira, Confluence, Bitbucket, Bamboo etc.
We had a script that was used to automate their access based on some conditions, so they get access directly without any manual transition we were calling APIs and parameterizing those APIs with user requests (project/role/username),
Problem & Scenario:
Now our JSM architecture has been changed and we are taking inputs from multiple ways as below:
1- Service (Project) → Insight Custom Field : for Every service there is an attribute Jira key which is basically Type: Project in Jira bringing all Jira projects in it to select and map, in short for every Service there is respective Jira Project here in this attribute
(E.g: Service name: A, Jira Key: A)
2- User Role and Components → are two fields those are *Forms (*ProForma) fields,
User role are list of roles we have defined in Jira, and Components are Jira, Wiki, Bitbucket, Bamboo
Looking For:
Here I would like to have a script which can provide the access to the requested user directly (automated) upon opening up a request, (transition can be done through automation) but I need a script to be executed in a post function to give them access instantly.
Dear @Syed Muhammad Umair Mansoor
For your first question, you can use the following method to get the project by ID:
def project = ComponentAccessor.getProjectManager().getProjectObj(projectKey)
Best Regards,
Seif,
Where I will pass the project ID, Can you please show me any executed script?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should replace the line 28 in your code by the line I proposed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Seifallah Bellassoued
Actually it worked after some reworks as shown below it was bringing Project: prefix with project key and Project id was coming with [] with it and was not accepting anything other then type Long
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.