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

Use JS code in the jira server Edited

Hi, I'm using jira software in my localhost, and I want to add JS code in my jira. So I used a plugin jsincluder, but there are a few modules here. I need to use require('p4api') module in js, so let me show you my code when I use it in my local file.

 

const P4 = require("p4api").P4
const p4 = new P4({
P4PORT: "myHost:1666",
P4USER: "username",
P4PASSWD: "password",
P4API_TIMEOUT: 5000
})

p4.cmd("changes")
.then(out =>{
console.log(out);
}).catch((err) => {
throw (err);
});

 here that code. This works perfectly, So is there a solution to use this code in jira?

Sorry for bad English. :)

1 answer

0 votes
Dario B Atlassian Team Jun 24, 2020

Hello @Mamikon Papikyan ,

I believe this thread has mistakenly been opened against the Jira Cloud collection while, from what I can read, it is about the jsincluder app for Jira Server. Can you confirm?

Also, from what I can see it looks like the app has been discontinued since in the marketplace listing for jsinclude:

 

However, even if I don't think I am the best person to answer this question, I believe all you have to do is to:

  1. Build p4api.js library as explained in: https://www.npmjs.com/package/p4api
  2. Include p4api.js (specify full path) at the top of your script in jsincluder, as shown in: https://www.npmjs.com/package/jsinclude

 

Also, please notice that if you are trying to integrate Jira with Perforce this might not be the best way to proceed and you might want to check the developers documentation explaining how to integrate with Jira Server instead:

 

Finally, for the future, in case help will be needed on development related issues please contact the resources you find in https://developer.atlassian.com/server/jira/platform/get-help/.

Specifically:

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
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...

265 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